[cfe-commits] r49271 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/Parser/declarators.c

Chris Lattner sabre at nondot.org
Sat Apr 5 23:50:56 PDT 2008


Author: lattner
Date: Sun Apr  6 01:50:56 2008
New Revision: 49271

URL: http://llvm.org/viewvc/llvm-project?rev=49271&view=rev
Log:
reject 'int test(x, x) int x; {}'

Modified:
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/test/Parser/declarators.c

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=49271&r1=49270&r2=49271&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Sun Apr  6 01:50:56 2008
@@ -1400,6 +1400,7 @@
 
   // Tok is known to be the first identifier in the list.  Remember this
   // identifier in ParamInfo.
+  ParamsSoFar.insert(Tok.getIdentifierInfo());
   ParamInfo.push_back(DeclaratorChunk::ParamInfo(Tok.getIdentifierInfo(),
                                                  Tok.getLocation(), 0));
   

Modified: cfe/trunk/test/Parser/declarators.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/declarators.c?rev=49271&r1=49270&r2=49271&view=diff

==============================================================================
--- cfe/trunk/test/Parser/declarators.c (original)
+++ cfe/trunk/test/Parser/declarators.c Sun Apr  6 01:50:56 2008
@@ -30,3 +30,5 @@
           atype         /* expected-error {{unexpected type name 'atype': expected identifier}} */
          ) int x, atype; {}
 
+int test4(x, x) int x; {} /* expected-error {{redefinition of parameter 'x'}} */
+





More information about the cfe-commits mailing list