when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays. This has slightly different semantics in some insane cases, but allows us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132983 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/DiagnosticSemaKinds.td 2 additions, 0 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- lib/Sema/SemaType.cpp 29 additions, 5 deletionslib/Sema/SemaType.cpp
- test/Sema/const-eval.c 1 addition, 1 deletiontest/Sema/const-eval.c
- test/Sema/i-c-e.c 1 addition, 1 deletiontest/Sema/i-c-e.c
- test/Sema/struct-decl.c 1 addition, 1 deletiontest/Sema/struct-decl.c
- test/Sema/typedef-variable-type.c 1 addition, 1 deletiontest/Sema/typedef-variable-type.c
- test/Sema/vla.c 2 additions, 2 deletionstest/Sema/vla.c
- test/SemaCXX/c99-variable-length-array.cpp 9 additions, 0 deletionstest/SemaCXX/c99-variable-length-array.cpp
Loading
Please register or sign in to comment