summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-11 06:13:16 +0000
committerChris Lattner <sabre@nondot.org>2008-11-11 06:13:16 +0000
commit8c5dd730cec8aa22fe04abf61cd44a27a4c74c1a (patch)
treebeeb4a84e15ff7260bc6b3e8a5e998730f00b534 /clang/lib/Sema/SemaDecl.cpp
parent2126a6d3c44889b1b6fee8484c29166b7ea68659 (diff)
downloadbcm5719-llvm-8c5dd730cec8aa22fe04abf61cd44a27a4c74c1a.tar.gz
bcm5719-llvm-8c5dd730cec8aa22fe04abf61cd44a27a4c74c1a.zip
Fix PR3031 by silencing follow-on errors in invalid declarations.
llvm-svn: 59027
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6c71d508953..879a79b633a 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud