diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-11 06:13:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-11 06:13:16 +0000 |
commit | 1f6f54be86a514d531ec231fd837858a43cfe72e (patch) | |
tree | 50dc81b86143c79228a31e1a6a43a553e4250d26 /lib/Sema/SemaDecl.cpp | |
parent | 48f475335a5250abb0936d7fef492c3b1dd44760 (diff) |
Fix PR3031 by silencing follow-on errors in invalid declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 6c71d50895..879a79b633 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -753,9 +753,10 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { // All of these full declarators require an identifier. If it doesn't have // one, the ParsedFreeStandingDeclSpec action should be used. if (II == 0) { - Diag(D.getDeclSpec().getSourceRange().getBegin(), - diag::err_declarator_need_ident, - D.getDeclSpec().getSourceRange(), D.getSourceRange()); + if (!D.getInvalidType()) // Reject this if we think it is valid. + Diag(D.getDeclSpec().getSourceRange().getBegin(), + diag::err_declarator_need_ident, + D.getDeclSpec().getSourceRange(), D.getSourceRange()); return 0; } |