summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-04-22 08:14:00 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-04-22 08:14:00 +0000
commite900b10a2929b1ea473a0e28f594613d9a075ed9 (patch)
tree8e737e07ca6d86bc15743b4f3e08948b8df234de /clang/lib
parentae95ad1935b7f52360c6a77031efd180f2554eec (diff)
downloadbcm5719-llvm-e900b10a2929b1ea473a0e28f594613d9a075ed9.tar.gz
bcm5719-llvm-e900b10a2929b1ea473a0e28f594613d9a075ed9.zip
Downgrade error "static declaration of 'foo' follows non-static declaration" to a warning in Microsoft mode.
llvm-svn: 129985
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 73f25a95c6d..4e31d03e0e9 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud