]> granicus.if.org Git - clang/commitdiff
Fix redundant errors for redefinitions with multiple existing definitions.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Sun, 8 Feb 2009 10:49:44 +0000 (10:49 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Sun, 8 Feb 2009 10:49:44 +0000 (10:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/Sema/tentative-decls.c

index cdb69305360ba617765e331dbe182ebe8cf413e9..f5681af0fa050c3f69e1f78e953b79a3ea7f72bf 100644 (file)
@@ -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;
       }
     }
   }
index 6390d9ca4dcf53873160635486d795106e84cc53..0e4b13a8434d7bcef0183e4fdf3a7f636d9e0170 100644 (file)
@@ -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[];