[Qt-creator] Clang code model issues

Julius Bullinger julius.bullinger at gmail.com
Fri Feb 8 12:15:23 CET 2019


Hi Nikolai,

On 08.02.2019 12:02, Nikolai Kosjar wrote:
> Hi!
> 
> I've started to write inline comments (see below), but it got quite
> confusing. Here is the summary.
> 
> I see these main issues from all your references:
> 
> 1) Several parse issues on or related to Windows.
>     ==> We've changed the internal clang command line and this might fix
> some issues related to parsing. At least it fixed several things on
> Linux, like parsing some boost headers or parsing with _GNU_SOURCE. The
> best you can do now is to provide feedback to the reports with current
> 4.9 snapshots. Qt Creator 4.9 release is scheduled for start of April.

I tested 4.9 yesterday, and didn't see any improvement. That's what 
prompted me to collect the feedback from other users to see if there are 
any issues that I could isolate in our project.

> 2) Parse issues related to _GNU_SOURCE.
>      ==> Fixed in Qt Creator 4.9.
> 
> 3) Generic project and the inability to specify extra flags like
> language version.
>      ==> Fixed in Qt Creator 4.9.
> 
> 4) For a problematic #include, following #includes are not considered.
>      ==> I will look into it.

That would be really appreciated. Note that it doesn't only concern 
problematic includes, but also simply the order of includes (see 
QTCREATORBUG-21892):

     If you remove (comment out) the first or the second marked line (3
     or 4) then the false positive in 18 is removed.
     Ok, if you remove the include of the non existing file, I would
     [buy] it.
     But if you remove the include of QString?
     [...]
     You can remove the false positive by swapping line 6 and 4, so that
     include QScopedPointer is in front of QString, too.

That's one issue I noticed with our projects: If I switch the order of 
includes around (e.g. by placing internal includes before or after Qt 
includes), the errors about unknown types also change. It seems like the 
further down an include is, the bigger is the chance that it will be 
unknown to clang.

Thanks and best regards,
Julius



More information about the Qt-creator mailing list