diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 10 |
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); + } } } |