diff options
-rw-r--r-- | Source/cmForEachCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmFunctionCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 17 | ||||
-rw-r--r-- | Source/cmMakefile.h | 2 | ||||
-rw-r--r-- | Source/cmWhileCommand.cxx | 3 |
7 files changed, 24 insertions, 8 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 436a91b..7a826c6 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -31,7 +31,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, if (!this->Depth) { // Remove the function blocker for this scope or bail. - cmsys::auto_ptr<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(lff)); + cmsys::auto_ptr<cmFunctionBlocker> + fb(mf.RemoveFunctionBlocker(this, lff)); if(!fb.get()) { return false; } // at end of for each execute recorded commands diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index c1ca8aa..04d8428 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -222,7 +222,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, mf.AddCommand(f); // remove the function blocker now that the function is defined - mf.RemoveFunctionBlocker(lff); + mf.RemoveFunctionBlocker(this, lff); return true; } else diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 74576b5..607031e 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -39,7 +39,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, if (!this->ScopeDepth) { // Remove the function blocker for this scope or bail. - cmsys::auto_ptr<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(lff)); + cmsys::auto_ptr<cmFunctionBlocker> + fb(mf.RemoveFunctionBlocker(this, lff)); if(!fb.get()) { return false; } // execute the functions for the true parts of the if statement diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 8613044..0a7d0dc 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -266,7 +266,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, mf.AddCommand(f); // remove the function blocker now that the macro is defined - mf.RemoveFunctionBlocker(lff); + mf.RemoveFunctionBlocker(this, lff); return true; } else diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c6bc4f2..890f752 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2422,7 +2422,8 @@ void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb) } cmsys::auto_ptr<cmFunctionBlocker> -cmMakefile::RemoveFunctionBlocker(const cmListFileFunction& lff) +cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb, + const cmListFileFunction& lff) { // Find the function blocker stack barrier for the current scope. // We only remove a blocker whose index is not less than the barrier. @@ -2438,8 +2439,20 @@ cmMakefile::RemoveFunctionBlocker(const cmListFileFunction& lff) { std::vector<cmFunctionBlocker*>::iterator pos = this->FunctionBlockers.begin() + (i - 1); - if ((*pos)->ShouldRemove(lff, *this)) + if (*pos == fb) { + // Warn if the arguments do not match, but always remove. + if(!(*pos)->ShouldRemove(lff, *this)) + { + cmListFileContext const& lfc = fb->GetStartingContext(); + cmOStringStream e; + e << "A logical block opening on the line\n" + << " " << lfc << "\n" + << "closes on the line\n" + << " " << lff << "\n" + << "with mis-matching arguments."; + this->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + } cmFunctionBlocker* b = *pos; this->FunctionBlockers.erase(pos); return cmsys::auto_ptr<cmFunctionBlocker>(b); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d565b29..c6061d7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -95,7 +95,7 @@ public: * This returns ownership of the function blocker object. */ cmsys::auto_ptr<cmFunctionBlocker> - RemoveFunctionBlocker(const cmListFileFunction& lff); + RemoveFunctionBlocker(cmFunctionBlocker* fb, const cmListFileFunction& lff); /** Push/pop a lexical (function blocker) barrier automatically. */ class LexicalPushPop diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index b6d8e36..cc16512 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -33,7 +33,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, if (!this->Depth) { // Remove the function blocker for this scope or bail. - cmsys::auto_ptr<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(lff)); + cmsys::auto_ptr<cmFunctionBlocker> + fb(mf.RemoveFunctionBlocker(this, lff)); if(!fb.get()) { return false; } std::string errorString; |