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

No longer possible to specify C++ standard level in generic project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.7.0
    • C/C++/Obj-C++ Support
    • None
    • macOS 10.13

    Description

      Motivation

      I often use Qt Creator with generic projects because the system I work with has its own way of building, and setting up something like cmake would be a pain for me. In fact I preferred Qt Creator because it made it simple and efficient to set up a project, and would intrude minimally on how the project was managed while still working very well as a (very) smart editor.

      Minimal example

      The issue I'm running into with recent versions might be related to the generic project defaulting to C++ 98. This is not entirely clear as some C++ 11 features work while others don't.

      Here's a demonstration:

      Put the following code in a .cpp file:
       

      #include <initializer_list> 
      int fun(std::initializer_list<int> list) { return list.size();}
      

      Create a generic project using File -> New Project -> Import Project.

      Observe the error shown by the clang code model. These are not errors in C++11 mode.  See screenshot.

      Discussion

      I believe the problem started in 4.7.0, though I'm not sure about 4.6.

      In earlier versions this problem did not exist.

      In earlier versions, I could add options like -std=c++ to the clang code model configuration and this effectively control the C++ language level. This is no longer possible in 4.7.0. It explicitly rejects any option that's not about controlling warnings.

      What fix I expect

      I would simply like to be able to use Qt Creator as before: as a smart editor, without being forced to set up a complex project that also includes build instructions. I only want to specify how to interpret the files (e.g. C or C++, standard level, etc.), not how to build the project.

      For those using generic projects, 4.7.0 is considerably less useful because it now assumes C++98 and I can't change that. Please restore the functionality level of previous versions.

      Attachments

        Issue Links

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

          Activity

            People

              kosjar Nikolai Kosjar
              szhorvat Szabolcs Horvát
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes