amykhuang wrote: Hi, this is causing failures for Chrome, building with c++20:
``` $ cat t.cc template <typename Type> class StrongAlias { friend constexpr bool operator==(const StrongAlias &, const StrongAlias &) = default; Type value; }; class Token {}; bool operator==(const Token&, const Token&); StrongAlias<Token> a; $ clang -std=c++20 t.cc t.cc:2:3: error: defaulted definition of equality comparison operator cannot be declared constexpr because it invokes a non-constexpr comparison function 2 | friend constexpr bool operator==(const StrongAlias &, const StrongAlias &) = default; | ^ t.cc:9:20: note: in instantiation of template class 'StrongAlias<Token>' requested here 9 | StrongAlias<Token> a; | ^ t.cc:3:8: note: non-constexpr comparison function would be used to compare member 'value' 3 | Type value; | ^ t.cc:7:6: note: non-constexpr comparison function declared here 7 | bool operator==(const Token&, const Token&); | ^ 1 error generated. ``` https://github.com/llvm/llvm-project/pull/77753 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits