Skip to content

cmake: do not pin the sigc++-2 code path to C++11 - #825

Open
plusky wants to merge 1 commit into
sm0svx:masterfrom
plusky:sigc-cxx17
Open

cmake: do not pin the sigc++-2 code path to C++11#825
plusky wants to merge 1 commit into
sm0svx:masterfrom
plusky:sigc-cxx17

Conversation

@plusky

@plusky plusky commented Aug 4, 2026

Copy link
Copy Markdown

FindSIGC.cmake and FindSIGC2.cmake put --std=c++11 into the compile flags of every target that links libsigc++-2.0. That flag lands last on the command line, so it overrides CMAKE_CXX_STANDARD and the level cannot be raised from outside the project.

Qt 6 headers no longer compile as C++11: <QtCore/qnumeric.h> pulls in qcheckedint_impl.h, which needs constexpr lambdas, three-way comparison and the qSubOverflow overloads introduced in C++17. Building 26.05.1 against Qt 6.11 therefore fails in async/qt and qtel with, among others:

qcheckedint_impl.h:301:5: error: the type ‘...::<lambda()>’ of ‘constexpr’ variable ‘f’ is not literal
qcheckedint_impl.h:292:35: error: no matching function for call to ‘compareThreeWay(int&, int&)’

libsigc++-2.0 builds fine at any level from C++11 upwards, and the sigc++-3.0 branch directly above already asks for C++17, so aligning the 2.x branch on C++17 costs nothing and unblocks Qt 6.

Found while updating the openSUSE package from 19.09.2 to 26.05.1; with this change the full build (including qtel against Qt 6.11.1) succeeds.

FindSIGC.cmake and FindSIGC2.cmake put "--std=c++11" into the compile flags of
every target that links libsigc++-2.0. That flag lands last on the command line,
so it overrides CMAKE_CXX_STANDARD and the level cannot be raised from outside
the project.

Qt 6 headers no longer compile as C++11: <QtCore/qnumeric.h> pulls in
qcheckedint_impl.h, which needs constexpr lambdas, three-way comparison and the
qSubOverflow overloads introduced in C++17. Building 26.05.1 against Qt 6.11
therefore fails in async/qt and qtel with, among others:

  qcheckedint_impl.h:301:5: error: the type '...::<lambda()>' of 'constexpr'
      variable 'f' is not literal
  qcheckedint_impl.h:292:35: error: no matching function for call to
      'compareThreeWay(int&, int&)'

libsigc++-2.0 builds fine at any level from C++11 upwards, and the sigc++-3.0
branch directly above already asks for C++17, so aligning the 2.x branch on
C++17 costs nothing and unblocks Qt 6.

Found while updating the openSUSE package from 19.09.2 to 26.05.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant