diff options
author | John McCall <rjmccall@apple.com> | 2010-08-01 20:20:59 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-01 20:20:59 +0000 |
commit | 626e96e2874698a6736fd33672fa9c28da91d77e (patch) | |
tree | eda9946bec66ba3c531df90b2ac3eb9045e7d5f0 /lib/Sema/SemaDeclCXX.cpp | |
parent | 1d8d1ccd36888f1120b3a1df9e76f35dc2edb81d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 3e48d5caee..d9215e5bbc 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/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); } } |