summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-01 20:20:59 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-01 20:20:59 +0000
commit47e40931c9af037ceae73ecab7db739a34160a0e (patch)
tree58595d6dbe7601fb5dae183533b67eb1ab583a14 /clang/lib/Sema/SemaDeclCXX.cpp
parent3d4af4e91ed7298137e828969e03caf822ad349d (diff)
downloadbcm5719-llvm-47e40931c9af037ceae73ecab7db739a34160a0e.tar.gz
bcm5719-llvm-47e40931c9af037ceae73ecab7db739a34160a0e.zip
Make a first pass at implementing -Wglobal-constructors. I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of this feature. llvm-svn: 109984
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 3e48d5caeee..d9215e5bbce 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -5358,6 +5358,9 @@ void Sema::FinalizeVarWithDestructor(VarDecl *VD, const RecordType *Record) {
PDiag(diag::err_access_dtor_var)
<< VD->getDeclName()
<< VD->getType());
+
+ if (!VD->isInvalidDecl() && VD->hasGlobalStorage())
+ Diag(VD->getLocation(), diag::warn_global_destructor);
}
}
OpenPOWER on IntegriCloud