diff options
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)) { |