[PATCH] D147673: [Clang] Improve designated inits diagnostic location

Bill Wendling via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 11:36:53 PDT 2023


void marked an inline comment as done.
void added inline comments.


================
Comment at: clang/test/SemaCXX/cxx2b-designated-initializers.cpp:13
+  const S result { // expected-error {{field designator (null) does not refer to any field in type 'const S'}}
+    .a = x
+  };
----------------
aaron.ballman wrote:
> rsmith wrote:
> > Why are we rejecting this?
> That's existing behavior: https://godbolt.org/z/48ThKbTor but we don't get the behavior when it's not a template (https://godbolt.org/z/f3zWaqdWr) or in C (https://godbolt.org/z/P1TqG43nG), so I agree that this should be accepted.
Also, if the "auto" above is changed to "int" this compiles just fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147673



More information about the cfe-commits mailing list