Bug 499835 - CMAKE_CXX_STANDARD version too high
Summary: CMAKE_CXX_STANDARD version too high
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 6.3.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-11 20:26 UTC by qxghwlzfoc
Modified: 2025-02-12 08:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
qtbase inclde patch (315 bytes, patch)
2025-02-12 04:03 UTC, Robert Holt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qxghwlzfoc 2025-02-11 20:26:39 UTC
Hello! I recently compiled the new version of kwin 6.3.0 using clang 19 and encountered a compilation error

```
In file included from /var/tmp/portage/kde-plasma/kwin-6.3.0/work/kwin-6.3.0/src/osd.cpp:7:
In file included from /var/tmp/portage/kde-plasma/kwin-6.3.0/work/kwin-6.3.0/src/osd.h:10:
In file included from /usr/include/qt6/QtCore/QFlags:1:
In file included from /usr/include/qt6/QtCore/qflags.h:7:
/usr/include/qt6/QtCore/qcompare_impl.h:26:49: error: no member named 'is_null_pointer_v' in namespace 'std'
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                                            ~~~~~^
/usr/include/qt6/QtCore/qcompare_impl.h:26:67: error: 'T' does not refer to a value
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                                                                   ^
/usr/include/qt6/QtCore/qcompare_impl.h:26:24: note: declared here
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                        ^
/usr/include/qt6/QtCore/qcompare_impl.h:26:77: error: expected member name or ';' after declaration specifiers
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                                                                             ^
3 errors generated.
```

After figuring out the code a bit, after setting the flag gnu/c++=20 this section of code compiled fine

SUMMARY


STEPS TO REPRODUCE
1. Have llvm-clang-19 with libcxx{abi}
2. Compile kwin project with default flags

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.13.2-cachyos (64-bit)/6.3.0
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Comment 1 Robert Holt 2025-02-12 04:03:30 UTC
Created attachment 178170 [details]
qtbase inclde patch

I encountered this as well, and I believe it's actually a QT bug. "qcompare_impl.h" appears to be missing an include for "<type_traits>", it must have been pulled in by a transitive include under C++20. I attached a patch for qtbase that I'm using which fixes compilation with clang.
Comment 2 David Redondo 2025-02-12 08:17:03 UTC
Please report to Qt/submit the patch to them thanks.