]> granicus.if.org Git - clang/commitdiff
reject 'int test(x, x) int x; {}'
authorChris Lattner <sabre@nondot.org>
Sun, 6 Apr 2008 06:50:56 +0000 (06:50 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Apr 2008 06:50:56 +0000 (06:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49271 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp
test/Parser/declarators.c

index cae0cbb8ecdf67ebd1b701340989a7669ed938a8..0cf97d22de77f0929d365945ddc97dad5d0f7a55 100644 (file)
@@ -1400,6 +1400,7 @@ void Parser::ParseFunctionDeclaratorIdentifierList(SourceLocation LParenLoc,
 
   // 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));
   
index 410ac3686f12617ec9b8275f6e2041134990be68..3e0380ea8786e621c45451132641913b1e4b7b9d 100644 (file)
@@ -30,3 +30,5 @@ int test3(x,
           atype         /* expected-error {{unexpected type name 'atype': expected identifier}} */
          ) int x, atype; {}
 
+int test4(x, x) int x; {} /* expected-error {{redefinition of parameter 'x'}} */
+