[Qt-creator] How set __cplusplus more than 201103L in QtC Editor?

Nikolai Kosjar nikolai.kosjar at qt.io
Wed Jan 3 17:08:26 CET 2018


On 01/03/2018 10:16 AM, Карелин Павел wrote:
> 
> 
> 02.01.2018 20:51, Карелин Павел пишет:
>>
>>
>> 02.01.2018 11:40, Eike Ziller пишет:
>>>> On 1. Jan 2018, at 18:39, Карелин Павел<hkarel at yandex.ru>  wrote:
>>>>
>>>>
>>>>
>>>> 01.01.2018 20:34,timur.kristof at gmail.com  пишет:
>>>>> Did 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.
> 
> Eike, there is still a question: the native Code Model will be 
> supported? Or in the future will remain only Clang Code Model?

The Clang Code Model will gradually take over. The support for the 
built-in code model is already limited now.

> --
> Pavel
> 
> 
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
> 




More information about the Qt-creator mailing list