-
Notifications
You must be signed in to change notification settings - Fork 111
Cpu: disable test on C++20 #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The C++20 standard has worsened operator== overload rules with its automatic operator!= derivation. Some cases that should still be legal were forcibly made ambiguous.
Codecov ReportBase: 97.96% // Head: 97.96% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #154 +/- ##
=======================================
Coverage 97.96% 97.96%
=======================================
Files 135 135
Lines 10940 10940
=======================================
Hits 10717 10717
Misses 223 223 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Huh. Which compiler? What does it say? If it's broken, it's not just the test being broken -- it means any code using the |
It's clang 15 in C++20 mode. Says |
Full error, please. What is it ambiguous with? Unfortunately I still don't have Clang 15 locally (details) so I can't look into this myself yet, and thus I either need to rely on you as a remote debugger, or you have to wait. Sorry 😅 |
[27/38] Building CXX object external/corrade/src/Corrade/Test/CMakeFiles/CpuTest.dir/CpuTest.cpp.obj
FAILED: external/corrade/src/Corrade/Test/CMakeFiles/CpuTest.dir/CpuTest.cpp.obj
C:\msys64\clang64\bin\c++.exe -DCORRADE_IS_DEBUG_BUILD -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_DISABLE_OBSOLETE_KEYIO -DJSON_HAS_THREE_WAY_COMPARISON=1 -DNOMINMAX -DUNICODE -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_UNICODE -IF:/dev/game/external/corrade/src -IF:/dev/game/build/external/corrade/src -fuse-cxa-atexit -O0 -g -ggdb -fstack-protector-all -fvisibility=hidden -fvisibility-inlines-hidden -fcolor-diagnostics -emit-llvm -fcolor-diagnostics -Wno-reserved-macro-identifier -Wno-error -Wno-undef -Wno-ignored-attributes -Wno-unused-function -Wno-unused-but-set-variable -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wmissing-prototypes -Wno-shorten-64-to-32 -Wunused-member-function -Wno-unneeded-member-function -std=c++2b -MD -MT external/corrade/src/Corrade/Test/CMakeFiles/CpuTest.dir/CpuTest.cpp.obj -MF external\corrade\src\Corrade\Test\CMakeFiles\CpuTest.dir\CpuTest.cpp.obj.d -o external/corrade/src/Corrade/Test/CMakeFiles/CpuTest.dir/CpuTest.cpp.obj -c F:/dev/game/external/corrade/src/Corrade/Test/CpuTest.cpp
F:/dev/game/external/corrade/src/Corrade/Test/CpuTest.cpp:577:30: warning: ISO C++20 considers use of overloaded operator '==' (with operand types 'const Corrade::Cpu::Sse3T' and 'const Corrade::Cpu::Sse3T') to be ambiguous despite there being a unique best viable function [-Wambiguous-reversed-operator]
CORRADE_VERIFY(Cpu::Sse3 == Cpu::Sse3);
~~~~~~~~~ ^ ~~~~~~~~~
F:/dev/game/external/corrade/src/Corrade/TestSuite/Tester.h:1591:69: note: expanded from macro 'CORRADE_VERIFY'
Corrade::TestSuite::Tester::instance().verify(#__VA_ARGS__, __VA_ARGS__); \
^~~~~~~~~~~
F:/dev/game/external/corrade/src/Corrade/Cpu.h:1528:74: note: ambiguity is between a regular call to this operator and a call with the argument order reversed
template<class T, class = decltype(TypeTraits<T>::Index)> constexpr bool operator==(T a, Features b) {
^
F:/dev/game/external/corrade/src/Corrade/Test/CpuTest.cpp:578:30: error: use of overloaded operator '!=' is ambiguous (with operand types 'const Corrade::Cpu::Sse3T' and 'const Corrade::Cpu::Sse41T')
CORRADE_VERIFY(Cpu::Sse3 != Cpu::Sse41);
~~~~~~~~~ ^ ~~~~~~~~~~
F:/dev/game/external/corrade/src/Corrade/TestSuite/Tester.h:1591:69: note: expanded from macro 'CORRADE_VERIFY'
Corrade::TestSuite::Tester::instance().verify(#__VA_ARGS__, __VA_ARGS__); \
^~~~~~~~~~~
F:/dev/game/external/corrade/src/Corrade/Cpu.h:1537:74: note: candidate function [with T = Corrade::Cpu::Sse3T, $1 = Corrade::Cpu::TypeTraits<Corrade::Cpu::Sse3T>::(unnamed enum at F:/dev/game/external/corrade/src/Corrade/Cpu.h:683:5)]
template<class T, class = decltype(TypeTraits<T>::Index)> constexpr bool operator!=(T a, Features b) {
^
F:/dev/game/external/corrade/src/Corrade/Cpu.h:1528:74: note: candidate function [with T = Corrade::Cpu::Sse3T, $1 = Corrade::Cpu::TypeTraits<Corrade::Cpu::Sse3T>::(unnamed enum at F:/dev/game/external/corrade/src/Corrade/Cpu.h:683:5)]
template<class T, class = decltype(TypeTraits<T>::Index)> constexpr bool operator==(T a, Features b) {
^
F:/dev/game/external/corrade/src/Corrade/Cpu.h:1528:74: note: candidate function (with reversed parameter order) [with T = Corrade::Cpu::Sse41T, $1 = Corrade::Cpu::TypeTraits<Corrade::Cpu::Sse41T>::(unnamed enum at F:/dev/game/external/corrade/src/Corrade/Cpu.h:691:5)]
1 warning and 1 error generated.
[28/38] Building CXX object test/CMakeFiles/floormat-test.dir/const-math.cpp.obj
[29/38] Building CXX object editor/CMakeFiles/floormat-editor.dir/imgui.cpp.obj
[30/38] Linking CXX executable DEBUG\bin\floormat-anim-crop-tool.exe
ninja: build stopped: subcommand failed. |
I have Clang 15 since yesterday (finally!), and this is fixed properly in 507a409. Took me a while to understand what Clang wanted, heh. |
I tried fixing it with
operator<=>
and then it becomes ambiguous with itself. This prevents me from running the test suite.