[PATCH] D154675: [Clang] Fix crash when emitting diagnostic for out of order designated initializers in C++

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 19:06:59 PDT 2023


shafik added inline comments.


================
Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:195
+    .c = 1, // reorder-error {{field 'd' will be initialized after field 'c'}} // reorder-note {{previous initialization for field 'c' is here}}
+    .b = 1, // reorder-error {{field 'c' will be initialized after field 'b'}} // reorder-note {{previous initialization for field 'e' is here}}
+    .a = 1, // reorder-error {{field 'e' will be initialized after field 'a'}}
----------------
Note the `e` in the diagnostic in this line and the next line should be `b`. I have not managed to figure out how to fix this yet but this feels relatively minor compared to the crash.


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

https://reviews.llvm.org/D154675



More information about the cfe-commits mailing list