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

[Regression] Simple QPair fails to compile in C++11 mode

    XMLWordPrintable

Details

    Description

       #include <QPair>
       int main(int, char **)
       {
           QPair<int[2], int> handler;
       }
      

      fails to compile when enabling C++11 mode with

      g++ -c -pipe -g -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I../qt5/55_install/include -I../qt5/55_install/include/QtGui -I../qt5/55_install/include/QtCore -I. -I../qt5/55_install/mkspecs/linux-g++ -o main.o main.cpp
      In file included from ../qt5/55_install/include/QtCore/qglobal.h:74:0,
                       from ../qt5/55_install/include/QtCore/qpair.h:37,
                       from ../qt5/55_install/include/QtCore/QPair:1,
                       from main.cpp:2:
      ../qt5/55_install/include/QtCore/qpair.h: In instantiation of ‘constexpr QPair<T1, T2>::QPair() [with T1 = int [2]; T2 = int]’:
      main.cpp:6:24:   required from here
      ../qt5/55_install/include/QtCore/qpair.h:49:45: error: functional cast to array type ‘int [2]’
               Q_DECL_NOEXCEPT_EXPR(noexcept(T1()) && noexcept(T2()))
                                                   ^
      ../qt5/55_install/include/QtCore/qcompilerdetection.h:1024:43: note: in definition of macro ‘Q_DECL_NOEXCEPT_EXPR’
       # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
                                                 ^
      ../qt5/55_install/include/QtCore/qpair.h: In instantiation of ‘constexpr QPair<T1, T2>::QPair() [with T1 = int [2]; T2 = int]’:
      main.cpp:6:24:   required from here
      ../qt5/55_install/include/QtCore/qpair.h:49:45: error: functional cast to array type ‘int [2]’
               Q_DECL_NOEXCEPT_EXPR(noexcept(T1()) && noexcept(T2()))
                                                   ^
      ../qt5/55_install/include/QtCore/qcompilerdetection.h:1024:43: note: in definition of macro ‘Q_DECL_NOEXCEPT_EXPR’
       # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
                                                 ^
      Makefile:407: recipe for target 'main.o' failed
      make: *** [main.o] Error 1
      

      This is a regression of Qt 5.5

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            tsdgeos_canonical Albert Astals Cid (Canonical) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes