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

Clang code model does not recognize std::string_view

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • Qt Creator 4.8.0-beta1
    • Qt Creator 4.7.0
    • C/C++/Obj-C++ Support
    • None
    • openSUSE Tumbleweed, x86_64, gcc 7.3.1, gcc 8.1.1

      Qt Creator does not recognize the std::string_view, std::filesystem::path, etc., because their definitions in the header files are "behind" the macro check:

      #if __cplusplus >= 201703L

      In the C++ Code Model Inspector in the Toolchain Defines:

      #define __cplusplus 201402L
      

      although for a C++17 it must be a 201703L.

      A temporary workaround for the Qbs projects, when the cpp.cxxLanguageVersion: "c++17" is defined, is:

      cpp.defines: ["__cplusplus=201703L"]
      

        For Gerrit Dashboard: QTCREATORBUG-20884
        # Subject Branch Project Status CR V

            kosjar Nikolai Kosjar
            vitech Viktor Kireev
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes