[cfe-commits] r132983 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaType.cpp test/Sema/const-eval.c test/Sema/i-c-e.c test/Sema/struct-decl.c test/Sema/typedef-variable-type.c test/Sema/vla.c test/SemaCXX/c99-variable-l
Chris Lattner
clattner at apple.com
Tue Jun 14 15:44:53 PDT 2011
On Jun 14, 2011, at 1:57 PM, Eli Friedman wrote:
> On Mon, Jun 13, 2011 at 11:38 PM, Chris Lattner <sabre at nondot.org> wrote:
>> Author: lattner
>> Date: Tue Jun 14 01:38:10 2011
>> New Revision: 132983
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=132983&view=rev
>> Log:
>> 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
>
> http://smooshlab.apple.com:8013/builders/gccTestSuite_clang-x86_64-darwin10-RA__c
Interesting, one instance (array-5.c) is failing exactly because of what we're trying to do here. Passing -std=c99 fixes the failure. Does anyone know how to do this to the test?
-Chris
More information about the cfe-commits
mailing list