================
@@ -2886,6 +2886,49 @@ class CXXPseudoDestructorExpr : public Expr {
   }
 };
 
+/// Represents a C++26 __builtin_type_order(T, U) expression. Used to implement
+/// std::type_order.
+class BuiltinTypeOrderExpr final : public Expr {
----------------
Tsche wrote:

That too would require special casing for this one of a kind builtin. We 
currently only support bool and size_t as return types, not int.

Returning size_t 1/2/3 and then in library `__builtin_type_order(U, T) <=> 1` 
could work (and I do have an implementation for that) but I find that strange. 

Generally speaking I don't feel great about returning magic numbers while also 
breaking libstdc++ compatibility for the sake of a smaller patch. Especially 
considering that we already have utilities to look up `std::strong_ordering` 
since we need it for the 3way comparison anyway. 

https://github.com/llvm/llvm-project/pull/216462
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to