Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.15.2
-
None
-
-
54c53223228539e3ca4126657ae52bc2fc705c71 (qt-creator/qt-creator/5.0)
Description
This bug is only reproducible on Windows MSVC, I tried it now on Linux and there it works like expected.
I have created New Project - Library - C++ library ( shared ), it is practically the default library cmake project.
I have changed the standard to 20:
set(CMAKE_CXX_STANDARD 20)
I pasted this code to the cpp file:
#include <type_traits> namespace Orm::Query {} template<typename T> concept Queryable = std::convertible_to<T, int> || std::invocable<T, int>;
And I get errors and warnings from the code model.
If the code model doesn't respect the selected c++ standard then it can be assumed that it doesn't respect CMAKE_CXX_EXTENSIONS too.
Used example project:
Main CMakeLists.txt file:
cpp file content:
And errors and warnings views:
As another proof the same works in the qmake project, here is the same example as the qmake project:
Open library_qmake.pro and uncomment CONFIG += c++11 and also comment #CONFIG += c++2a, by this you select c++11 standard and you get exactly the same errors and warnings as I have reported above. So it is absolutely clear that QtCreator doesn't set up the underlying library correctly. ( I don't know what is used to obtain warnings and errors by the Code Model, I'm guessing libclang? )