Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25860

Static anlyzer: C++20 std version check macros failed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.15.0
    • None
    • Linux/X11

      Hi

      I have a C++20 cmake project which uses boost.

      Boost in its headers uses something like

      #if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
      // something c++20 here
      #endif

      No matter what I do in my CMakeLists.txt the analyzer doesn't come inside of this macro block.

      Currently I have something like following in the CMakeLists.txt

      cmake_minimum_required(VERSION 3.20)
      project(Demo)
      
      set(CMAKE_CXX_STANDARD 20)
      set(CMAKE_CXX_STANDARD_REQUIRED True)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
      
      add_executable(demo main.cpp)
      
      set_property(TARGET demo PROPERTY CXX_STANDARD 20)
      target_compile_features(demo PUBLIC cxx_std_20) 

      The project compiles fine, but analyzer shows errors because it doesn't understand c++20.
      No problem with C++17 though.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kandeler Christian Kandeler
            rion Rion
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes