summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2010-09-16 20:05:59 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2010-09-16 20:05:59 (GMT)
commit05cb0f4daf6941482784eb06c549c5c63a9d895b (patch)
treeb2139b17892d4dae73d31e15c68e63e4bdf0b20e /Source/cmMakefile.cxx
parent91c4c9921c40361df860c1384a46ed77c6118c23 (diff)
downloadCMake-05cb0f4daf6941482784eb06c549c5c63a9d895b.zip
CMake-05cb0f4daf6941482784eb06c549c5c63a9d895b.tar.gz
CMake-05cb0f4daf6941482784eb06c549c5c63a9d895b.tar.bz2
Check for unused variables in the dtor
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 844b302..774612a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -178,6 +178,15 @@ bool cmMakefile::NeedCacheCompatibility(int major, int minor)
cmMakefile::~cmMakefile()
{
+ std::set<cmStdString> usage = this->Internal->VarUsageStack.top();
+ std::set<cmStdString>::const_iterator it = usage.begin();
+ for (; it != usage.end(); ++it)
+ {
+ if (!this->VariableUsed(it->c_str()))
+ {
+ this->CheckForUnused("out of scope", it->c_str());
+ }
+ }
for(std::vector<cmInstallGenerator*>::iterator
i = this->InstallGenerators.begin();
i != this->InstallGenerators.end(); ++i)