summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-03-24 01:01:41 +0000
committerAnders Carlsson <andersca@mac.com>2011-03-24 01:01:41 +0000
commit98766db7858379f61d24d5d93b1b7be39fda0913 (patch)
tree34cd9888b7ae4411d8c2c81419fe0d44469d7742 /clang/lib
parent49c79790de4fc43d10c35114d06b81d2e81772c1 (diff)
downloadbcm5719-llvm-98766db7858379f61d24d5d93b1b7be39fda0913.tar.gz
bcm5719-llvm-98766db7858379f61d24d5d93b1b7be39fda0913.zip
Add a new warning for exit-time destructors.
llvm-svn: 128188
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 220c22ad0f5..edee86476ba 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -6102,9 +6102,13 @@ void Sema::FinalizeVarWithDestructor(VarDecl *VD, const RecordType *Record) {
<< VD->getDeclName()
<< VD->getType());
- // TODO: this should be re-enabled for static locals by !CXAAtExit
- if (!VD->isInvalidDecl() && VD->hasGlobalStorage() && !VD->isStaticLocal())
- Diag(VD->getLocation(), diag::warn_global_destructor);
+ if (!VD->isInvalidDecl() && VD->hasGlobalStorage()) {
+ // TODO: this should be re-enabled for static locals by !CXAAtExit
+ if (!VD->isStaticLocal())
+ Diag(VD->getLocation(), diag::warn_global_destructor);
+
+ Diag(VD->getLocation(), diag::warn_exit_time_destructor);
+ }
}
}
OpenPOWER on IntegriCloud