llvm-project/clang/lib
Eli Friedman 5955a0f937 Allow flexible array initialization in C++.
Flexible array initialization is a C/C++ extension implemented in many
compilers to allow initializing the flexible array tail of a struct type
that contains a flexible array. In clang, this is currently restricted
to C. But this construct is used in the Microsoft SDK headers, so I'd
like to extend it to C++.

For now, this doesn't handle dynamic initialization; probably not hard
to implement, but it's extra code, and I don't think it's necessary for
the expected uses.  And we explicitly fail out of constant evaluation.

I've added some additional code to assert that initializers have the
correct size, with or without flexible array init. This might catch
issues unrelated to flexible array init.

Differential Revision: https://reviews.llvm.org/D123649
2022-04-14 11:56:40 -07:00
..
APINotes [clang][APINotes] Fix -Wunused-function warning (NFC) 2021-04-01 09:52:43 +08:00
ARCMigrate [clang] Use true/false instead of 1/0 (NFC) 2022-01-09 00:19:47 -08:00
AST Allow flexible array initialization in C++. 2022-04-14 11:56:40 -07:00
ASTMatchers Reland "[ASTMatchers] Output currently matching node on crash" 2022-04-05 21:47:16 +01:00
Analysis [clang][dataflow] Weaken abstract comparison to enable loop termination. 2022-04-13 19:49:50 +00:00
Basic [InlineAsm] Add support for address operands ("p"). 2022-04-13 12:50:21 +02:00
CodeGen Allow flexible array initialization in C++. 2022-04-14 11:56:40 -07:00
CrossTU [analyzer][ctu] Only import const and trivial VarDecls 2022-04-01 13:49:39 +02:00
DirectoryWatcher [clang] [DirectoryWatcher] Remove leading \\?\ from GetFinalPathNameByHandleW 2021-11-08 22:21:30 +02:00
Driver [PS4] Fix a couple of typos 2022-04-14 10:14:17 -07:00
Edit [clang] Use true/false instead of 1/0 (NFC) 2022-01-09 00:19:47 -08:00
ExtractAPI [clang][extract-api] Add support for true anonymous enums 2022-04-12 20:42:17 +01:00
Format [clang-format] Skip preprocessor lines when finding the record lbrace 2022-04-14 09:31:15 -07:00
Frontend [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
FrontendTool [C++20][Modules][HU 1/5] Introduce header units as a module type. 2022-03-25 09:17:14 +00:00
Headers [OpenCL] Remove argument names from math builtins 2022-04-06 11:43:59 +01:00
Index [clang] Reformat 2022-03-24 05:56:23 -07:00
IndexSerialization
Interpreter [clang-repl] Add an accessor to our underlying execution engine 2022-03-11 09:24:47 +00:00
Lex [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
Parse [HLSL] Add Semantic syntax, and SV_GroupIndex 2022-04-14 10:21:58 -05:00
Rewrite Add assert on End iteration distance to Rewriter::getRewrittenText. 2022-01-25 17:26:13 +00:00
Sema Allow flexible array initialization in C++. 2022-04-14 11:56:40 -07:00
Serialization [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
StaticAnalyzer [analyzer] Don't track function calls as control dependencies 2022-04-08 10:16:58 +02:00
Testing
Tooling [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
CMakeLists.txt [clang][extract-api] Refactor ExtractAPI and improve docs 2022-03-22 13:21:57 -07:00