[PATCH] D73637: Fix handling of OO_Spaceship in DecodeOperatorCall

Stephan Bergmann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 09:12:37 PST 2020


sberg created this revision.
sberg added reviewers: rsmith, EricWF.
sberg added a project: clang.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73637

Files:
  clang/lib/AST/StmtProfile.cpp


Index: clang/lib/AST/StmtProfile.cpp
===================================================================
--- clang/lib/AST/StmtProfile.cpp
+++ clang/lib/AST/StmtProfile.cpp
@@ -1535,8 +1535,8 @@
     return Stmt::BinaryOperatorClass;
 
   case OO_Spaceship:
-    // FIXME: Update this once we support <=> expressions.
-    llvm_unreachable("<=> expressions not supported yet");
+    BinaryOp = BO_Cmp;
+    return Stmt::BinaryOperatorClass;
 
   case OO_AmpAmp:
     BinaryOp = BO_LAnd;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73637.241182.patch
Type: text/x-patch
Size: 487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200129/13406036/attachment-0001.bin>


More information about the cfe-commits mailing list