[PATCH] D154486: [Clang] Fix a crash when trying to initialize an invalid aggregate.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 05:29:38 PDT 2023


aaron.ballman added a comment.

Precommit CI found issues with the newly added test that should be addressed.



================
Comment at: clang/docs/ReleaseNotes.rst:633-634
   (`#63012 <https://github.com/llvm/llvm-project/issues/63012>`_)
+- Fix a crash when trying to parentheses-initialize an invalid aggregate.
+  (`#63278 <https://github.com/llvm/llvm-project/issues/63278>`_)
 
----------------
This is a new regression introduced in Clang 17, so I don't think we need a release note, right?


================
Comment at: clang/lib/Sema/SemaInit.cpp:9390
 
+  auto *Init = CurInit.get();
+  if (!Init)
----------------
Please spell out the type (and make it a const pointer if possible).


================
Comment at: clang/test/SemaCXX/paren-list-agg-init.cpp:281
+  int b {0};
+  auto x = 1; // expected-error {{'auto' not allowed in non-static struct member}}
+};
----------------
Probably worth it to add a `static auto y = 1;` case as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154486



More information about the cfe-commits mailing list