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

global/qrandom.cpp:420:50: error: the type 'const QRandomGenerator::SystemAndGlobalGenerators' of constexpr variable 'g' is not literal

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P0: Blocker
    • Resolution: Done
    • Affects Version/s: 5.10.0 Beta 4
    • Fix Version/s: 5.10.0 RC
    • Labels:
      None
    • Environment:
    • Commits:
      1a05a7149358a5b5fb11b1f87a85760cc182a726

      Description

      https://codereview.qt-project.org/#/c/210816/
      https://testresults.qt.io/coin/integration/qt/qt5/tasks/1510506318
      https://testresults.qt.io/coin/api/results/qt/qtbase/3e1d272570eb6caa022545828f80c24b656bad6e/LinuxRHEL_7_4x86_64QNXQNX_700x86GCCqtci-linux-RHEL-7.4-x86_64-53f812Release_DisableTests_OpenGLES2_NoUseGoldLinker/2a48a3b7dcb9652b1532a3ad14de7580b5b9b1ee/build_1510507054/log.txt.gz

      ...
      global/qrandom.cpp: In member function 'void QRandomGenerator::SystemAndGlobalGenerators::confirmLiteral()':
      global/qrandom.cpp:420:50: error: the type 'const QRandomGenerator::SystemAndGlobalGenerators' of constexpr variable 'g' is not literal
               constexpr SystemAndGlobalGenerators g = {};
                                                        ^
      global/qrandom.cpp:387:26: note: 'QRandomGenerator::SystemAndGlobalGenerators' is not literal because:
       struct QRandomGenerator::SystemAndGlobalGenerators
                                ^
      global/qrandom.cpp:401:17: note:   non-static data member 'QRandomGenerator::SystemAndGlobalGenerators::globalPRNGMutex' has non-literal type
           QBasicMutex globalPRNGMutex;
                       ^
      In file included from ../../include/QtCore/qmutex.h:1:0,
                       from global/qrandom.cpp:46:
      ../../include/QtCore/../../src/corelib/thread/qmutex.h:67:21: note: 'QBasicMutex' is not literal because:
       class Q_CORE_EXPORT QBasicMutex
                           ^
      ../../include/QtCore/../../src/corelib/thread/qmutex.h:67:21: note:   'QBasicMutex' is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
      ../../include/QtCore/../../src/corelib/thread/qmutex.h:67:21: note: 'QBasicMutex::QBasicMutex()' is not usable as a constexpr function because:
      In file included from ../../include/QtCore/qbasicatomic.h:1:0,
                       from ../../include/QtCore/../../src/corelib/thread/qatomic.h:46,
                       from ../../include/QtCore/qatomic.h:1,
                       from global/qglobal.h:1179,
                       from global/qt_pch.h:56:
      ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:315:5: note: defaulted constructor calls non-constexpr 'QBasicAtomicPointer<X>::QBasicAtomicPointer() [with X = QMutexData]'
           QBasicAtomicPointer() = default;
           ^
      In file included from global/qt_pch.h:56:0:
      global/qglobal.h:755:36: error: static assertion failed: std::is_literal_type<SystemAndGlobalGenerators>::value
       #define Q_STATIC_ASSERT(Condition) static_assert(bool(Condition), #Condition)
                                          ^
      global/qrandom.cpp:422:9: note: in expansion of macro 'Q_STATIC_ASSERT'
               Q_STATIC_ASSERT(std::is_literal_type<SystemAndGlobalGenerators>::value);
               ^
      cc: /opt/qnx700/host/linux/x86_64/usr/lib/gcc/i586-pc-nto-qnx7.0.0/5.4.0/cc1plus error 1
      Makefile:12002: recipe for target '.obj/qrandom.o' failed
      make[2]: *** [.obj/qrandom.o] Error 1
      make[2]: *** Waiting for unfinished jobs....
      make[2]: Leaving directory '/home/qt/work/qt/qtbase/src/corelib'
      Makefile:224: recipe for target 'sub-corelib-make_first' failed
      make[1]: *** [sub-corelib-make_first] Error 2
      make[1]: *** Waiting for unfinished jobs....
      g++ -Wl,--gc-sections -Wl,-O1 -o ../../../bin/qdbuscpp2xml .obj/moc.o .obj/preprocessor.o .obj/generator.o .obj/parser.o .obj/token.o .obj/qdbuscpp2xml.o   -L/home/qt/work/qt/qtbase/lib -lQt5BootstrapDBus -lQt5Bootstrap -lpthread 
      make[2]: Leaving directory '/home/qt/work/qt/qtbase/src/tools/qdbuscpp2xml'
      make[1]: Leaving directory '/home/qt/work/qt/qtbase/src'
      Makefile:48: recipe for target 'sub-src-make_first' failed
      make: *** [sub-src-make_first] Error 2
      ...
      

      https://testresults.qt.io/coin/api/results/qt/qtbase/3e1d272570eb6caa022545828f80c24b656bad6e/LinuxRHEL_7_4x86_64INTEGRITYINTEGRITY_11_04armv7GCCqtci-linux-RHEL-7.4-x86_64-53f812Release_DisableTests_OpenGLES2_NoUseGoldLinker/2a48a3b7dcb9652b1532a3ad14de7580b5b9b1ee/build_1510507060/log.txt.gz

      ...
      "global/qrandom.cpp", line 420: error #1982-D: target stack alignment is
                insufficient to guarantee alignment of variable "g"
                constexpr SystemAndGlobalGenerators g = {};
                                                    ^
      
      "global/qrandom.cpp", line 420: error #3026: a constexpr variable must have a
                literal type or a reference type
                constexpr SystemAndGlobalGenerators g = {};
                ^
      
      "global/qrandom.cpp", line 422: error #1489: static assertion failed with
                "std::is_literal_type<SystemAndGlobalGenerators>::value"
                Q_STATIC_ASSERT(std::is_literal_type<SystemAndGlobalGenerators>::value);
                ^
      
      Makefile:11062: recipe for target '.obj/qrandom.o' failed
      make[2]: *** [.obj/qrandom.o] Error 1
      make[2]: *** Waiting for unfinished jobs....
      make[2]: Leaving directory '/home/qt/work/qt/qtbase/src/corelib'
      Makefile:226: recipe for target 'sub-corelib-make_first' failed
      make[1]: *** [sub-corelib-make_first] Error 2
      make[1]: Leaving directory '/home/qt/work/qt/qtbase/src'
      Makefile:48: recipe for target 'sub-src-make_first' failed
      make: *** [sub-src-make_first] Error 2
      ...
      

        Attachments

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

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              liaqi Liang Qi
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes