This is an archive of the discontinued LLVM Phabricator instance.

Fix handling of OO_Spaceship in DecodeOperatorCall
AbandonedPublic

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

Details

Reviewers
rsmith
EricWF
Summary

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.Jan 29 2020, 9:12 AM
sberg updated this revision to Diff 241485.Jan 30 2020, 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.Feb 13 2020, 1:10 AM