]> granicus.if.org Git - clang/commitdiff
Allow VLAs in C++ if in GNU mode (GNU C++ permits them). Clang can now compile Langu...
authorDavid Chisnall <csdavec@swan.ac.uk>
Mon, 11 Jan 2010 22:33:19 +0000 (22:33 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Mon, 11 Jan 2010 22:33:19 +0000 (22:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93198 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaType.cpp

index 2bddf9ecd608cd681fb2ebc3f3855c7f6a643d9d..0f9bd516b4906747dae9a4a9e7dd2fed41f1f1ed 100644 (file)
@@ -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))