Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 11.0.3
-
None
-
-
3581d1c5d (12.0)
Description
Given the following reduced / self-contained CMake-Project (CMakeLists.txt):
cmake_minimum_required(VERSION 3.27.6) project(foo) set(CMAKE_CXX_STANDARD 20) set(CONTENT [[ #include <concepts> template<typename T> concept FooConcept = requires(T foo) { foo.bar(); }; ]]) file(WRITE foo.hpp "${CONTENT}") file(WRITE foo.cpp "#include \"foo.hpp\"") file(WRITE bar.c "void bar() {}") add_library(foo SHARED foo.cpp bar.c foo.hpp) set_property(SOURCE bar.c APPEND PROPERTY COMPILE_OPTIONS -fno-fast-math )
Opening foo.hpp in the IDE generates (among others) the code model error:
Unknown type name 'concept'
Inspecting the code models I see three contexts.
I am not sure why three (I would have understood two).
The context (which in my case is used by default) that presumably causes the issue lists the compiler flags:
-g -fPIC -fno-fast-math
Another context (which works correctly if selected manually) lists the flags:
-DQT_QML_DEBUG -g -std=gnu++20 -fPIC
A third context is for "C" and does not apply to foo.hpp.
I would assume that the first context should not exist at all or should also include the `-std=gnu++20` flag.