Post by ÐаÑелин ÐавелPost by Eike ZillerPost by t***@gmail.comDid you try with the clang code model?
I use the GCC compiler only. Is it possible to use the clang model in this case? In addition, I have a fairly old OS: Ubuntu 14.04.
Which compiler you use for compiling your code does not really matter for the decision on the code model that you use in Qt Creator (except possibly in borderline cases that you probably do not care about...). Even compiler specific defines should be correctly identifying your compiler to be GCC when you specify this in the kit.
So you should definitely try the Clang code model - it handles many template situations and most C++11/14/17 situations much better than the built-in model.
Br, Eike
a) Failed to build the "Clang Code Model" plugin on my system
(Kubuntu 14.04). Cause: On "my" system can install llvm-3.9, but I do
not have the file /usr/lib/llvm-3.9/include/llvm-s/Inndex.h, so the
validation of the clanProbes does not work.
b) I installed the pre-build QtC 4.5.0. ClangCode model - works. The
std::condition_variable highlighting correctly, but many warnings from
system header-files that I would prefer not to see. I assume that the
system header-files are written correctly ;)
c) I decided to dwell on the original version, but slightly modified.
I add "-std=c++11" in the function languageOption()
static const QStringList languageOption(Core::Id languageId)
{
   if (languageId == Constants::C_LANGUAGE_ID)
       return {"-x", "c"};
   return {"-x", "c++", "-std=c++11"};
}
Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.
BR, Pavel.