summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2010-01-11 22:33:19 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2010-01-11 22:33:19 +0000
commit394bf0d0ba9f5b89ce5fdfa1f024e92a2deada22 (patch)
treeb22b21788ae084a50d108c817030dd43af377fda /clang/lib
parent9d75c966e0020de84404d9d23be6724b0b63d82d (diff)
downloadbcm5719-llvm-394bf0d0ba9f5b89ce5fdfa1f024e92a2deada22.tar.gz
bcm5719-llvm-394bf0d0ba9f5b89ce5fdfa1f024e92a2deada22.zip
Allow VLAs in C++ if in GNU mode (GNU C++ permits them). Clang can now compile LanguageKit, although the resulting code crashes (although not in any of the functions that use VLAs).
llvm-svn: 93198
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaType.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 2bddf9ecd60..0f9bd516b49 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -651,8 +651,10 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
}
T = Context.getConstantArrayType(T, ConstVal, ASM, Quals);
}
- // If this is not C99, extwarn about VLA's and C99 array size modifiers.
- if (!getLangOptions().C99) {
+ // If this is not C99 or C++ with GNU extenisons, extwarn about VLA's and C99
+ // array size modifiers.
+ if (!getLangOptions().C99 &&
+ !(getLangOptions().CPlusPlus && getLangOptions().GNUMode)) {
if (ArraySize && !ArraySize->isTypeDependent() &&
!ArraySize->isValueDependent() &&
!ArraySize->isIntegerConstantExpr(Context))
OpenPOWER on IntegriCloud