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
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index cdb6930..f5681af 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -604,6 +604,8 @@
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 6390d9c..0e4b13a 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[];