aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-02-08 10:49:44 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-02-08 10:49:44 +0000
commit89ef6e03665635d965ba6c92035a85b125e6c78c (patch)
tree2994bc412845eb80d4b5507dba450bcc4eb40b0c
parentddf7e994b55ed2f161e22dfab8db14997e22c01c (diff)
Fix redundant errors for redefinitions with multiple existing definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64081 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--test/Sema/tentative-decls.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index cdb6930536..f5681af0fa 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -604,6 +604,8 @@ void Sema::CheckForFileScopedRedefinitions(Scope *S, VarDecl *VD) {
VD->getStorageClass() != VarDecl::PrivateExtern) {
Diag(VD->getLocation(), diag::err_redefinition) << VD->getDeclName();
Diag(OldDecl->getLocation(), diag::note_previous_definition);
+ // One redefinition error is enough.
+ break;
}
}
}
diff --git a/test/Sema/tentative-decls.c b/test/Sema/tentative-decls.c
index 6390d9ca4d..0e4b13a843 100644
--- a/test/Sema/tentative-decls.c
+++ b/test/Sema/tentative-decls.c
@@ -1,6 +1,4 @@
// RUN: clang %s -verify -fsyntax-only
-// XFAIL
-// fails due to exact diagnostic matching
const int a [1] = {1};
extern const int a[];