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

ClangIndexingSettingsManager doesn't compile in MSVC

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      4abe476a4bf3ce50dd901fac3580f7a9f392d717 (qt-creator/qt-creator/master)

      Description

      ClangIndexingSettingsManager class uses an std::map with std::unique_ptr. MSVC tries to generate a default copy constructor and a default operator=. It fails, because std::unique_ptr cannot be explicitly copied. The compiler issues error C2280 "attempting to reference a deleted function".

      To make MSVC cool, one can explicitly delete copy constructor and operator = from ClangIndexingSettingsManager. Suggested fix is to add these two lines to ClangIndexingSettingsManager class:

          ClangIndexingSettingsManager(const ClangIndexingSettingsManager &) = delete;
          ClangIndexingSettingsManager &operator=(const ClangIndexingSettingsManager &) = delete;
      

        Attachments

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

          Activity

            People

            Assignee:
            bubke Marco Bubke
            Reporter:
            dreghor Pavel Baxtin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes