diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-06 06:47:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-06 06:47:48 +0000 |
commit | aaf9ddbeab08a43203cf6b9ca4986c8c6fe6fdc6 (patch) | |
tree | caadd21ecd2045055bbc8f5f60bab5ec3625f554 /lib/Parse/ParseDecl.cpp | |
parent | 50c6477a06186aeee50415fd90e5f71da68e8616 (diff) |
reject 'typedef int y; int test(x, y)'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 9445a4862c..cae0cbb8ec 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/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)) { |