From 4bada2e3f20a3c76f5493e3163eafc02258c5902 Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Fri, 22 Apr 2011 19:50:06 +0000 Subject: [PATCH] Do not return true from MergeFunctionDecl for a warn_static_non_static warning in Microsoft mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130010 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 611031b4bd..e506dd502a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1258,12 +1258,14 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) { New->getStorageClass() == SC_Static && Old->getStorageClass() != SC_Static && !canRedefineFunction(Old, getLangOptions())) { - unsigned DiagID = diag::err_static_non_static; - if (getLangOptions().Microsoft) - DiagID = diag::warn_static_non_static; - Diag(New->getLocation(), DiagID) << New; - Diag(Old->getLocation(), PrevDiag); - return true; + if (getLangOptions().Microsoft) { + Diag(New->getLocation(), diag::warn_static_non_static) << New; + Diag(Old->getLocation(), PrevDiag); + } else { + Diag(New->getLocation(), diag::err_static_non_static) << New; + Diag(Old->getLocation(), PrevDiag); + return true; + } } // If a function is first declared with a calling convention, but is -- 2.50.1