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
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 73f25a9..4e31d03 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1258,8 +1258,10 @@
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;
}