diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 08:14:00 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 08:14:00 +0000 |
commit | 2e510a0c0f7afa7951aa19c65a06c2da579535a8 (patch) | |
tree | 6a75d0630c977c2d451bd981d07465b76d07e4e8 /lib/Sema/SemaDecl.cpp | |
parent | 2ac0b7a2f10f64503b74f96a11993459805dd2f8 (diff) |
Downgrade error "static declaration of 'foo' follows non-static declaration" to a warning in Microsoft mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 73f25a95c6..4e31d03e0e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1258,8 +1258,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) { New->getStorageClass() == SC_Static && Old->getStorageClass() != SC_Static && !canRedefineFunction(Old, getLangOptions())) { - Diag(New->getLocation(), diag::err_static_non_static) - << New; + 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; } |