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

Including QJSPrimitiveValue breaks consumer builds with -fno-operator-names

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11
    • de480dd21 (dev), 1e5f08286 (6.5), 6854d3539 (dev)

    Description

      When building ki18n against current Qt dev I'm getting the following error

       

      FAILED: autotests/CMakeFiles/ki18n-declarativetest.dir/ki18ndeclarativetest.cpp.o  
      /usr/lib64/ccache/c++ -DKI18N_DEPRECATED_WARNINGS_SINCE=0x56700 -DKI18N_DISABLE_DEPRECATED_BEFORE_AND_AT=0x56700 -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS_SINCE=0x70000 -DQT_DISABLE_DEPRECATED_BEFORE=0x60400 -DQT_F
      ORCE_ASSERTS -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_URL_CAST_FROM_STRING -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_
      STRICT_ITERATORS -DQT_TESTCASE_BUILDDIR=\"/home/nico/kde6/build/ki18n/autotests\" -DQT_TESTCASE_SOURCEDIR=\"/home/nico/kde6/src/ki18n/autotests\" -DQT_TESTLIB_LIB -DQT_USE_QSTRINGBUILDER -D_GNU_SOURCE -D_LARGEFI
      LE64_SOURCE -I/home/nico/kde6/build/ki18n/autotests -I/home/nico/kde6/src/ki18n/autotests -I/home/nico/kde6/build/ki18n/autotests/ki18n-declarativetest_autogen/include -I/home/nico/kde6/build/ki18n/src/i18n -I/h
      ome/nico/kde6/src/ki18n/src/i18n -isystem /home/nico/qt6/include/QtTest -isystem /home/nico/qt6/include -isystem /home/nico/qt6/include/QtCore -isystem /home/nico/qt6/mkspecs/linux-g++ -isystem /home/nico/qt6/in
      clude/QtQml -isystem /home/nico/qt6/include/QtQmlIntegration -isystem /home/nico/qt6/include/QtNetwork -pipe -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wn
      o-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Werror=undef -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -pedantic -Wzero-as-null-pointer-
      constant -Wmissing-include-dirs -fdiagnostics-color=always -O2 -g -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -std=c++17 -MD -MT autotests/CMakeFiles/ki18n-declarativetest.dir/ki18ndeclarative
      test.cpp.o -MF autotests/CMakeFiles/ki18n-declarativetest.dir/ki18ndeclarativetest.cpp.o.d -o autotests/CMakeFiles/ki18n-declarativetest.dir/ki18ndeclarativetest.cpp.o -c /home/nico/kde6/src/ki18n/autotests/ki18
      ndeclarativetest.cpp
      
      In file included from /home/nico/qt6/include/QtQml/qjsmanagedvalue.h:8,
      
                       from /home/nico/qt6/include/QtQml/qjsengine.h:14,
      
                       from /home/nico/qt6/include/QtQml/qqmlengine.h:10,
      
                       from /home/nico/qt6/include/QtQml/QQmlEngine:1,
      
                       from /home/nico/kde6/src/ki18n/autotests/ki18ndeclarativetest.cpp:9:
      
      /home/nico/qt6/include/QtQml/qjsprimitivevalue.h: In static member function 'static bool QJSPrimitiveValue::MulOperators::opOverflow(int, int, int*)':
      
      /home/nico/qt6/include/QtQml/qjsprimitivevalue.h:98:28: error: expected ')' before 'xor'
      
         98 |             if (((lhs < 0) xor (rhs < 0)) && (*result == 0))
      
            |                            ^~~
      
      /home/nico/qt6/include/QtQml/qjsprimitivevalue.h:98:17: note: to match this '('
      
         98 |             if (((lhs < 0) xor (rhs < 0)) && (*result == 0))
      
            |                 ^
      
      /home/nico/qt6/include/QtQml/qjsprimitivevalue.h:99:28: error: expected ')' before ';' token
      
         99 |                 return true; // result must be negative 0, does not fit into int
      
            |                            ^
      
      /home/nico/qt6/include/QtQml/qjsprimitivevalue.h:98:16: note: to match this '('
      
         98 |             if (((lhs < 0) xor (rhs < 0)) && (*result == 0))
      
            |    

       

       

      qtdeclarative commit 7827d7b27f142c2035ab8aa69d3ed0907d74f238

      KDE's extra-cmake-modules adds -fno-operator-names to the compiler args. Qt headers should be compatible with that

      https://codereview.qt-project.org/c/qt/qtdeclarative/+/452324 introduced the problem

       

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            nicolasfella Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes