How do I enable C++14 in the ClangCodeModel (or even the "normal" one)?
I added CONFIG += c++14
in the .pro
file and the project compiles fine with both gcc
and clang
but the IDE is annyoing me with spurious warnings on C++14 constructs.
When looking at the "C++ Code Model Inspector", the "Project Parts->General" tab says
Language Version CXX11
despite the config entry. It seems the IDE's CodeModel does not pick that up.
Go to Tools -> Options -> C++ -> Code Model.
Find the group "Clang Code Model Warnings" and "Copy" the current configuration ("Warnings for almost everything [built-in]" by default) in order to edit them.
In your new configuration add:
-std=c++14
to the end of the list of warnings and restart QtCreator. Just hitting apply or even refreshing the model does not work.
Afterwards the warnings should disappear. Let me know if it works!
I'm using Qt Creator 4.0.3 on Ubuntu 16.04.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With