[cfe-commits] r65140 - in /cfe/trunk: lib/Sema/SemaDecl.cpp lib/Sema/SemaType.cpp test/Sema/typedef-variable-type.c

Eli Friedman eli.friedman at gmail.com
Fri Feb 20 16:35:59 PST 2009


On Fri, Feb 20, 2009 at 10:53 AM, Anders Carlsson <andersca at mac.com> wrote:
> Author: andersca
> Date: Fri Feb 20 12:53:20 2009
> New Revision: 65140
>
> URL: http://llvm.org/viewvc/llvm-project?rev=65140&view=rev
> Log:
> Always try to fold array sizes, and warn if we could fold something that isn't an ICE. This makes us compatible with GCC.

And incompatible with the standard!  The solution we were using was
picked with good reason: VLAs type compatibility rules are different
such that the difference is visible to the user.  Also, this patch
will warn on perfectly legitimate cases, like the following:
int a() {
int x[!0.0];
x[0] = 2;
return x[0];
}

I'll try and come up with a proper fix.

-Eli



More information about the cfe-commits mailing list