aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
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
commit2b32dad701ef3e666e3b9cea02e1d094a1078c6f (patch)
treec9e7dc73e253f2bc5ede3663665807202bd0866c /lib/Sema/SemaDeclCXX.cpp
parent5188507b9a1b09ec95c14ffadf0e832f2b47aa8a (diff)
Add a new warning for exit-time destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 220c22ad0f..edee86476b 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/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);
+ }
}
}