[cfe-commits] r148610 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseExpr.cpp lib/Sema/AnalysisBasedWarnings.cpp lib/Sema/SemaExpr.cpp test/Sema/i-c-e.c test/Sema/vla-2.c test/SemaCXX/vararg-non-pod.cpp

Enea Zaffanella zaffanella at cs.unipr.it
Sat Jan 28 09:37:01 PST 2012


On 01/21/2012 02:01 AM, Eli Friedman wrote:
> Author: efriedma
> Date: Fri Jan 20 19:01:51 2012
> New Revision: 148610
>
> URL: http://llvm.org/viewvc/llvm-project?rev=148610&view=rev
> Log:
> Make clang's AST model sizeof and typeof with potentially-evaluated operands correctly, similar to what we already do with typeid.
>
>
> Added:
>      cfe/trunk/test/Sema/vla-2.c
> Modified:
>      cfe/trunk/include/clang/Sema/Sema.h
>      cfe/trunk/lib/Parse/ParseDecl.cpp
>      cfe/trunk/lib/Parse/ParseExpr.cpp
>      cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
>      cfe/trunk/lib/Sema/SemaExpr.cpp
>      cfe/trunk/test/Sema/i-c-e.c
>      cfe/trunk/test/SemaCXX/vararg-non-pod.cpp


It seems that this change is causing a spurious parse error on the 
following program fragment:

$ cat bug.c
int foo(int a) {
   return sizeof(*(int(*)[({ goto v; v: a;})]) 0);
}


$ clang -fsyntax-only bug.c
bug.c:2:37: error:
       redefinition of label 'v'
   return sizeof(*(int(*)[({ goto v; v: a;})]) 0);
                                     ^
bug.c:2:37: note: previous
       definition is here
1 error generated.

Enea.



More information about the cfe-commits mailing list