diff options
author | Mital Ashok <mital@mitalashok.co.uk> | 2024-06-20 18:44:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 19:44:06 +0200 |
commit | 482c41e992c1edf8833a4577b56ff9dda49fbc83 (patch) | |
tree | 6a606c6bb325ce7e825bdc50a07ce6e734badb7a /clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp | |
parent | 6cea40400df542a1a4a6d35b45cbe3367f2c32b7 (diff) | |
download | llvm-482c41e992c1edf8833a4577b56ff9dda49fbc83.zip llvm-482c41e992c1edf8833a4577b56ff9dda49fbc83.tar.gz llvm-482c41e992c1edf8833a4577b56ff9dda49fbc83.tar.bz2 |
[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).
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp index 2004993..150e3ac 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace-ignore-implicit-constructors.cpp @@ -4,10 +4,11 @@ // RUN: true}}" namespace std { -template <typename> +template <typename E> class initializer_list { public: + const E *a, *b; initializer_list() noexcept {} }; |