Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49658

MSVC 2015 Compilation error with QPair

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.0
    • 5.7
    • None
    • Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
    • f253f76aca4eb82a6df11c00a25c178e16253c9d

    Description

      QPair in 5.7 leads to compilation errors in MSVC 2015 RTM. This is a stripped down version of a compilation error in qtenginio module:

      #include <QPair>
      #include <QString>
      
      struct Q_DECL_EXPORT C : public QPair<bool, QString>
      {
      };
      

      MSVC 2015 x86 output:

      cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -I..\untitled2 -I. -I..\..\qt\dev\msvc-2015-32\qtbase\include -I..\..\qt\dev\msvc-2015-32\qtbase\include\QtCore -Irelease -I..\..\qt\dev\src\qtbase\mkspecs\win32-msvc2015 -Forelease\ @C:\Users\kakoehne\AppData\Local\Temp\main.obj.11304.16.jom
      main.cpp
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): error C2065: 'TT1': undeclared identifier
      jom: D:\dev\tmp\build-untitled2-dev_msvc_2015_32-Release\Makefile.Release [release\main.obj] Error 2
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(QPair<TT1,TT2> &&) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): error C2923: 'std::is_nothrow_assignable': 'TT1' is not a valid template type argument for parameter '_From'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(QPair<TT1,TT2> &&) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): error C2955: 'std::is_nothrow_assignable': use of class template requires template argument list
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits(799): note: see declaration of 'std::is_nothrow_assignable'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(QPair<TT1,TT2> &&) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): error C2065: 'TT2': undeclared identifier
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(QPair<TT1,TT2> &&) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): error C2923: 'std::is_nothrow_assignable': 'TT2' is not a valid template type argument for parameter '_From'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(QPair<TT1,TT2> &&) noexcept(<expr>)'
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits(799): note: see declaration of 'std::is_nothrow_assignable'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): error C2057: expected constant expression
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(77): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(QPair<TT1,TT2> &&) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): error C2065: 'TT1': undeclared identifier
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(const QPair<TT1,TT2> &) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): error C2059: syntax error: '>'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(const QPair<TT1,TT2> &) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): error C2976: 'std::is_nothrow_assignable': too few template arguments
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits(799): note: see declaration of 'std::is_nothrow_assignable'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(const QPair<TT1,TT2> &) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): error C2955: 'std::is_nothrow_assignable': use of class template requires template argument list
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits(799): note: see declaration of 'std::is_nothrow_assignable'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(const QPair<TT1,TT2> &) noexcept(<expr>)'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): error C2065: 'TT2': undeclared identifier
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(const QPair<TT1,TT2> &) noexcept(<expr>)'
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits(799): note: see declaration of 'std::is_nothrow_assignable'
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits(799): note: see declaration of 'std::is_nothrow_assignable'
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): error C2057: expected constant expression
      d:\dev\qt\dev\msvc-2015-32\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qpair.h(65): note: This diagnostic occurred in the compiler generated function 'QPair<bool,QString> &QPair<bool,QString>::operator =(const QPair<TT1,TT2> &) noexcept(<expr>)'
      

      Attachments

        For Gerrit Dashboard: QTBUG-49658
        # Subject Branch Project Status CR V

        Activity

          People

            kkohne Kai Köhne
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes