Page MenuHomePhabricator

Fix handling of OO_Spaceship in DecodeOperatorCall

Authored by sberg on Wed, Jan 29, 9:12 AM.



This seems to be a leftover from d30b23d6a54b3f0883914f3c2c2318a78edcbe67 "[c++2a] P0515R3: Support for overloaded operator<=>." (The corresponding llvm_unreachable in clang/lib/Sema/SemaOverload.cpp was e.g. fixed in 0683c0e68d31d18f6e4fedb270317844a4912882 "[C++2a] Implement operator<=> CodeGen and ExprConstant".)
It caused compilation of recent libstdc++ trunk <vector> to crash in -std=c++2a mode, hitting the llvm_unreachable.

Diff Detail

Event Timeline

sberg created this revision.Wed, Jan 29, 9:12 AM
sberg updated this revision to Diff 241485.Thu, Jan 30, 9:07 AM

Minimal reproducer is

template<typename> struct S;
template<typename T> void operator <=>(S<T>, S<T>);
template<typename T> void f(T x) { decltype(x <=> x) v; }

Added a corresponding test to clang/test/SemaCXX/cxx2a-three-way-comparison.cpp.

An equivalent patch was landed as llvmorg-11-init-2132-gb96c6b65b93 to fix PR44786. Thanks!

sberg abandoned this revision.Thu, Feb 13, 1:10 AM