[cfe-commits] r93198 - /cfe/trunk/lib/Sema/SemaType.cpp
David Chisnall
csdavec at swan.ac.uk
Mon Jan 11 14:33:19 PST 2010
Author: theraven
Date: Mon Jan 11 16:33:19 2010
New Revision: 93198
URL: http://llvm.org/viewvc/llvm-project?rev=93198&view=rev
Log:
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).
Modified:
cfe/trunk/lib/Sema/SemaType.cpp
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=93198&r1=93197&r2=93198&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Mon Jan 11 16:33:19 2010
@@ -651,8 +651,10 @@
}
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))
More information about the cfe-commits
mailing list