summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-06 06:47:48 +0000
committerChris Lattner <sabre@nondot.org>2008-04-06 06:47:48 +0000
commit67b450cb4841ab1c0dcb36a3fcc331d6d694c6be (patch)
tree2bc7b7e11fc600a7acb5fe324406a2bdf0092128 /clang/lib/Parse/ParseDecl.cpp
parent9186f556cce4faaec9e2f453e0146b9e800d6e86 (diff)
downloadbcm5719-llvm-67b450cb4841ab1c0dcb36a3fcc331d6d694c6be.tar.gz
bcm5719-llvm-67b450cb4841ab1c0dcb36a3fcc331d6d694c6be.zip
reject 'typedef int y; int test(x, y)'.
llvm-svn: 49270
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 9445a4862c6..cae0cbb8ecd 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1415,8 +1415,12 @@ void Parser::ParseFunctionDeclaratorIdentifierList(SourceLocation LParenLoc,
SkipUntil(tok::r_paren);
return;
}
-
+
IdentifierInfo *ParmII = Tok.getIdentifierInfo();
+
+ // Reject 'typedef int y; int test(x, y)', but continue parsing.
+ if (Actions.isTypeName(*ParmII, CurScope))
+ Diag(Tok, diag::err_unexpected_typedef_ident, ParmII->getName());
// Verify that the argument identifier has not already been mentioned.
if (!ParamsSoFar.insert(ParmII)) {
OpenPOWER on IntegriCloud