diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 04d842888..2b5223b3a 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -104,6 +104,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass } // we push a scope on the makefile + cmMakefile::LexicalPushPop lexScope(this->Makefile); cmMakefile::ScopePushPop varScope(this->Makefile); static_cast(varScope); @@ -163,6 +164,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass { // The error message should have already included the call stack // so we do not need to report an error here. + lexScope.Quiet(); inStatus.SetNestedError(true); return false; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 0a7d0dc7b..9cc2653ba 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -107,6 +107,9 @@ bool cmMacroHelperCommand::InvokeInitialPass return false; } + // Enforce matching logical blocks inside the macro. + cmMakefile::LexicalPushPop lexScope(this->Makefile); + // set the value of argc cmOStringStream argcDefStream; argcDefStream << expandedArgs.size(); @@ -215,6 +218,7 @@ bool cmMacroHelperCommand::InvokeInitialPass { // The error message should have already included the call stack // so we do not need to report an error here. + lexScope.Quiet(); inStatus.SetNestedError(true); return false; }