llvm-project/clang/lib/Sema
Richard Smith 552c6c2328 PR44406: Follow behavior of array bound constant folding in more recent versions of GCC.
Old GCC used to aggressively fold VLAs to constant-bound arrays at block
scope in GNU mode. That's non-conforming, and more modern versions of
GCC only do this at file scope. Update Clang to do the same.

Also promote the warning for this from off-by-default to on-by-default
in all cases; more recent versions of GCC likewise warn on this by
default.

This is still slightly more permissive than GCC, as pointed out in
PR44406, as we still fold VLAs to constant arrays in structs, but that
seems justifiable given that we don't support VLA-in-struct (and don't
intend to ever support it), but GCC does.

Differential Revision: https://reviews.llvm.org/D89523
2020-10-16 14:34:35 -07:00
..
AnalysisBasedWarnings.cpp Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"" 2020-09-24 11:16:54 -07:00
CMakeLists.txt On Windows build, making the /bigobj flag global , instead of passing it per file. 2020-07-28 18:04:36 -05:00
CodeCompleteConsumer.cpp Remove llvm::Error include form Diagnostic.h 2020-04-06 10:42:17 -07:00
CoroutineStmtBuilder.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclSpec.cpp [clang]: Remove assertion which checks explicit declaration 2020-08-20 18:15:43 -07:00
DelayedDiagnostic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IdentifierResolver.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
JumpDiagnostics.cpp [OPENMP]Simplify representation for atomic, critical, master and section 2020-08-07 09:58:23 -04:00
MultiplexExternalSemaSource.cpp Merge some of the PCH object support with modular codegen 2020-07-22 12:46:12 -07:00
OpenCLBuiltins.td [OpenCL] Add sub-group builtin functions 2020-04-02 13:18:56 +01:00
ParsedAttr.cpp [Sema] Silence warnings when targeting x86 with VS2019 16.5.4 2020-05-06 09:11:59 -04:00
Scope.cpp Un-revert "[coroutines][PR40978] Emit error for co_yield within catch block" 2019-03-25 00:53:10 +00:00
ScopeInfo.cpp PR42104: Support instantiations of lambdas that implicitly capture 2019-06-04 17:17:20 +00:00
Sema.cpp Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"" 2020-09-24 11:16:54 -07:00
SemaAccess.cpp [c++20] Delete defaulted comparison functions if they would invoke an 2019-12-10 19:28:30 -08:00
SemaAttr.cpp [FPEnv] Evaluate constant expressions under non-default rounding modes 2020-09-26 17:59:39 +07:00
SemaAvailability.cpp Prune TargetInfo.h include from ParsedAttr.h, NFC 2020-03-11 20:47:11 -07:00
SemaCUDA.cpp Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"" 2020-09-24 11:16:54 -07:00
SemaCXXScopeSpec.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
SemaCast.cpp [AST][RecoveryExpr] Support dependent cast-expr in C for error-recovery. 2020-10-08 10:00:29 +02:00
SemaChecking.cpp Don't reject calls to MinGW's unusual _setjmp declaration. 2020-10-02 15:12:15 -07:00
SemaCodeComplete.cpp [clang] Make signature help work with dependent args 2020-08-17 10:06:36 +02:00
SemaConcept.cpp [clang][NFC] Remove spurious +x flag on SemaConcept.cpp 2020-07-26 17:10:59 +01:00
SemaConsumer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SemaCoroutine.cpp [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter 2020-10-12 12:00:20 -07:00
SemaDecl.cpp PR44406: Follow behavior of array bound constant folding in more recent versions of GCC. 2020-10-16 14:34:35 -07:00
SemaDeclAttr.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaDeclCXX.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaDeclObjC.cpp Ensure that InheritedAttrs are properly inherited along a redeclaration 2020-10-12 19:22:31 -07:00
SemaExceptionSpec.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaExpr.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaExprCXX.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaExprMember.cpp Improve modeling of variable template specializations with dependent 2020-08-09 23:22:26 -07:00
SemaExprObjC.cpp [clang] Implement objc_non_runtime_protocol to remove protocol metadata 2020-10-02 17:35:50 -04:00
SemaFixItUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SemaInit.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaLambda.cpp [AST][FPEnv] Keep FP options in trailing storage of CastExpr 2020-09-14 12:15:21 +07:00
SemaLookup.cpp [Sema] Split special builtin type lookups into a separate function 2020-09-21 19:12:29 +03:00
SemaModule.cpp [DeclCXX] Remove unknown external linkage specifications 2019-11-21 15:23:05 +02:00
SemaObjCProperty.cpp [AST][FPEnv] Keep FP options in trailing storage of CastExpr 2020-09-14 12:15:21 +07:00
SemaOpenMP.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaOverload.cpp [clang] Use isCompoundAssignmentOp to simplify the code, NFC. 2020-10-07 09:50:43 +02:00
SemaPseudoObject.cpp Reland D81869 "Modify FPFeatures to use delta not absolute settings" 2020-06-27 01:34:57 -07:00
SemaSYCL.cpp Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"" 2020-09-24 11:16:54 -07:00
SemaStmt.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaStmtAsm.cpp Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"" 2020-09-24 11:16:54 -07:00
SemaStmtAttr.cpp Implements [[likely]] and [[unlikely]] in IfStmt. 2020-09-09 20:48:37 +02:00
SemaTemplate.cpp Switch the default of VerifyIntegerConstantExpression from constant 2020-10-15 16:58:47 -07:00
SemaTemplateDeduction.cpp [AST] Reduce the size of TemplateArgumentLocInfo. 2020-09-21 13:08:53 +02:00
SemaTemplateInstantiate.cpp Revert "[SYCL] Implement __builtin_unique_stable_name." 2020-10-12 01:10:09 -04:00
SemaTemplateInstantiateDecl.cpp [SemaTemplate] Stop passing insertion position around during VarTemplate instantiation 2020-10-12 16:48:50 -07:00
SemaTemplateVariadic.cpp Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"" 2020-09-24 11:16:54 -07:00
SemaType.cpp PR44406: Follow behavior of array bound constant folding in more recent versions of GCC. 2020-10-16 14:34:35 -07:00
TreeTransform.h Ensure TreeTransform considers ParmVarDecls as transformed Decls 2020-10-12 14:38:04 -07:00
TypeLocBuilder.cpp [NFC] avoid AlignedCharArray in clang 2019-07-29 23:12:48 +00:00
TypeLocBuilder.h [NFC] avoid AlignedCharArray in clang 2019-07-29 23:12:48 +00:00
UsedDeclVisitor.h DeferredDiagnosticsEmitter crashes 2020-10-08 11:42:21 -04:00