From 482c41e992c1edf8833a4577b56ff9dda49fbc83 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Thu, 20 Jun 2024 18:44:06 +0100 Subject: [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (#95580) This checks if the layout of `std::initializer_list` is something Clang can handle much earlier and deduplicates the checks in CodeGen/CGExprAgg.cpp and AST/ExprConstant.cpp Also now diagnose `union initializer_list` (Fixes #95495), bit-field for the size (Fixes a crash that would happen during codegen if it were unnamed), base classes (that wouldn't be initialized) and polymorphic classes (whose vtable pointer wouldn't be initialized). --- clang/docs/ReleaseNotes.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/docs') diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 36e2398..92ada51 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -598,6 +598,10 @@ Improvements to Clang's diagnostics - Clang no longer emits a "declared here" note for a builtin function that has no declaration in source. Fixes #GH93369. +- Clang now diagnoses unsupported class declarations for ``std::initializer_list`` when they are + used rather than when they are needed for constant evaluation or when code is generated for them. + The check is now stricter to prevent crashes for some unsupported declarations (Fixes #GH95495). + Improvements to Clang's time-trace ---------------------------------- -- cgit v1.1