[PATCH] D129531: [clang][C++20] P0960R3 and P1975R0: Allow initializing aggregates from a parenthesized list of values

Alan Zhao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 13:21:00 PST 2022


ayzhao added inline comments.


================
Comment at: clang/test/CXX/class/class.compare/class.spaceship/p1.cpp:106
       Cmp<G2>() <=> Cmp<G2>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}Cmp<{{.*}}G2>' first required here}}j
-      // expected-error@#cmp {{no matching conversion for static_cast from 'void' to 'std::strong_ordering'}}
+      // expected-error@#cmp {{static_cast from 'void' to 'std::strong_ordering' is not allowed}}
       Cmp<H>() <=> Cmp<H>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}Cmp<{{.*}}H>' first required here}}j
----------------
ilya-biryukov wrote:
> Do you have any idea why did this diagnostic change?
Fixed - I needed to add a line to `SemaCast.cpp`


================
Comment at: clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp:131
+// pre20-error at -2 {{no matching constructor for initialization of 'B'}}
+// post20-error at -3 {{excess elements in struct initializer}}
+// post20-error at -4 {{excess elements in struct initializer}}
----------------
ilya-biryukov wrote:
> Given how pervasive this error is right now, I feel that we want to add a name of the struct to this message.
> This case is also a good example of how this diagnostic can be really low quality with templates: it's unclear which exact base class causes a problem here from the compiler output,.
> 
> Maybe open a GH issue for that? It seems like an independent task that will also affect braced initializers and may need test file updates.
Created https://github.com/llvm/llvm-project/issues/59367


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129531/new/

https://reviews.llvm.org/D129531



More information about the cfe-commits mailing list