llvm-project/clang/test
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
ARCMT Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
AST Reland "[AST] Add a new TemplateKind for template decls found via a using decl."" 2022-04-14 11:04:55 +02:00
ASTMerge Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
Analysis [clang][OpenMP5.1] Initial parsing/sema for has_device_addr 2022-04-08 21:19:38 -07:00
CXX Reland "[AST] Add a new TemplateKind for template decls found via a using decl."" 2022-04-14 11:04:55 +02:00
ClangScanDeps [clang][deps] Ensure deterministic filename case 2022-04-08 09:18:00 +02:00
CodeCompletion Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
CodeGen [AArch64] Adjust aarch64 constrained intrinsics tests and un-XFAIL 2022-04-14 16:51:22 +01:00
CodeGenCUDA [CUDA][HIP] Fix host used external kernel in archive 2022-04-13 10:47:16 -04:00
CodeGenCUDASPIRV [Driver][test] Remove unused/obsoleted REQUIRES: clang-driver 2022-04-12 13:29:46 -07:00
CodeGenCXX Allow flexible array initialization in C++. 2022-04-14 11:56:40 -07:00
CodeGenCoroutines [test] Remove references to -fexperimental-new-pass-manager in tests 2022-04-11 13:29:08 -07:00
CodeGenHIP [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
CodeGenHLSL Add clang DirectX target support 2022-03-28 15:00:50 -05:00
CodeGenObjC [CGCall] Check store type in findDominatingStoreToReturnValue() 2022-04-11 12:08:29 +02:00
CodeGenObjCXX [test] Remove various legacy pass manager tests 2022-04-11 14:02:17 -07:00
CodeGenOpenCL [Clang] Add -no-opaque-pointers to more tests (NFC) 2022-04-07 12:53:29 +02:00
CodeGenOpenCLCXX [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
CodeGenSYCL [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
Coverage [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
CoverageMapping Revert "[InstrProfiling] No runtime hook for unused funcs" 2022-04-06 01:41:44 +00:00
Driver [Driver] Change CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL to affect driver default instead of cc1 default 2022-04-13 16:58:00 -07:00
ExtractAPI [clang][extract-api] Add support for true anonymous enums 2022-04-12 20:42:17 +01:00
FixIt [C89/C2x] Improve diagnostics around strict prototypes in C 2022-04-08 16:19:58 -04:00
Format [clang-format] Allow empty .clang-format file 2022-04-12 21:20:54 -07:00
Frontend Support the min of module flags when linking, use for AArch64 BTI/PAC-RET 2022-04-13 09:31:51 +02:00
Headers [Clang] Add -no-opaque-pointers to more tests (NFC) 2022-04-07 12:53:29 +02:00
Import
Index [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
Integration Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
InterfaceStubs Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Interpreter
Layout
Lexer Reland "[MTE] Add -fsanitize=memtag* and friends." 2022-04-08 14:28:33 -07:00
LibClang
Misc [test] Remove references to -fno-legacy-pass-manager in tests 2022-04-11 13:40:27 -07:00
Modules [C++20][Modules] Add testcases from section 10.2 dependent on header units. 2022-04-11 11:30:45 +01:00
OpenMP [test] Remove references to -fexperimental-new-pass-manager in tests 2022-04-11 13:29:08 -07:00
PCH [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
Parser [C89/C2x] Improve diagnostics around strict prototypes in C 2022-04-08 16:19:58 -04:00
ParserHLSL [HLSL] Add Semantic syntax, and SV_GroupIndex 2022-04-14 10:21:58 -05:00
ParserSYCL
Preprocessor [Driver][test] Remove unused/obsoleted REQUIRES: clang-driver 2022-04-12 13:29:46 -07:00
Profile [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
Refactor Use functions with prototypes when appropriate; NFC 2022-02-12 07:25:06 -05:00
Rewriter [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
Sema [Clang][AArch64][SVE] Add shift operators for SVE vector types 2022-04-14 13:20:50 +01:00
SemaCUDA [CUDA] Don't call inferCUDATargetForImplicitSpecialMember too early. 2022-03-31 13:49:12 -07:00
SemaCXX Allow flexible array initialization in C++. 2022-04-14 11:56:40 -07:00
SemaHLSL [HLSL] Pointers are unsupported in HLSL 2022-04-14 13:32:51 -05:00
SemaObjC [C89/C2x] Improve diagnostics around strict prototypes in C 2022-04-08 16:19:58 -04:00
SemaObjCXX Revert "[clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially relocatable""." 2022-03-23 04:54:00 -07:00
SemaOpenCL [OpenCL] Add device enqueue guards for DSE builtins 2022-04-11 11:27:51 +01:00
SemaOpenCLCXX [OpenCL] Add support of __opencl_c_device_enqueue feature macro. 2022-01-27 14:25:59 +03:00
SemaSYCL [SYCL] Disallow explicit casts between mismatching address spaces 2022-02-07 11:57:30 +03:00
SemaTemplate [Clang][Sema] Prohibit statement expression in the default argument 2022-04-06 09:28:20 +08:00
TableGen
Templight [Templight] Don't display empty strings for names of unnamed template parameters 2022-01-24 16:37:11 +01:00
Tooling
Unit Use lit_config.substitute instead of foo % lit_config.params everywhere 2022-03-16 09:57:41 +01:00
VFS [VFS] RedirectingFileSystem only replace path if not already mapped 2022-04-11 14:52:48 -07:00
clang-rename
utils/update_cc_test_checks [Clang] Add -no-opaque-pointers to more tests (NFC) 2022-04-07 12:53:29 +02:00
.clang-format
CMakeLists.txt [Driver] Change CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL to affect driver default instead of cc1 default 2022-04-13 16:58:00 -07:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [Driver] Change CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL to affect driver default instead of cc1 default 2022-04-13 16:58:00 -07:00
lit.site.cfg.py.in [Driver] Change CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL to affect driver default instead of cc1 default 2022-04-13 16:58:00 -07:00
make_test_dirs.pl