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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 04:50:50 PDT 2023


aaron.ballman 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
+  };
----------------
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.


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