From 05cb0f4daf6941482784eb06c549c5c63a9d895b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 16 Sep 2010 16:05:59 -0400 Subject: [PATCH] Check for unused variables in the dtor --- Source/cmMakefile.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 844b3022f..774612a95 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -178,6 +178,15 @@ bool cmMakefile::NeedCacheCompatibility(int major, int minor) cmMakefile::~cmMakefile() { + std::set usage = this->Internal->VarUsageStack.top(); + std::set::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::iterator i = this->InstallGenerators.begin(); i != this->InstallGenerators.end(); ++i)