diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 19:50:06 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 19:50:06 +0000 |
commit | 4bada2e3f20a3c76f5493e3163eafc02258c5902 (patch) | |
tree | d4a9c6e2e27dded26056812ef4c15120b5eb1155 /lib/Sema/SemaDecl.cpp | |
parent | a61aedc48efae959d951d2aadadbac3e6d49acc5 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 14 |
1 files 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 |