[PATCH] D103850: [clang] diagnose instead of assert for defaulted comparison return type deduction.

2021-06-16 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/test/CXX/class/class.compare/class.spaceship/p2.cpp:200 + struct b3 { +auto operator<=>(b3 const &) const = default; // expected-error {{cannot be deduced because three-way comparison for member 'f' would compare as builtin

[PATCH] D103850: [clang] diagnose instead of assert for defaulted comparison return type deduction.

2021-06-16 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/test/CXX/class/class.compare/class.spaceship/p2.cpp:200 + struct b3 { +auto operator<=>(b3 const &) const = default; // expected-error {{cannot be deduced because three-way comparison for member 'f' would compare as builtin

[PATCH] D103850: [clang] diagnose instead of assert for defaulted comparison return type deduction.

2021-06-07 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:7876 + diag:: + err_defaulted_comparison_cannot_deduce_unsupported_builtin_type) + << Subobj.Kind << Subobj.Decl << T; I think this

[PATCH] D103850: [clang] diagnose instead of assert for defaulted comparison return type deduction.

2021-06-07 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When deducing the return type of defaulted three-way comparison, instead of asserting in the case of unsupported builtin types, just diagnose it. For