From 89ef6e03665635d965ba6c92035a85b125e6c78c Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Sun, 8 Feb 2009 10:49:44 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaDecl.cpp | 2 ++ test/Sema/tentative-decls.c | 2 -- 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[]; -- 2.50.1