mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
ENH: Enforce logical blocks in functions/macros
This teaches function() and macro() to enforce matching logical blocks inside the recorded bodies. This makes the error message more specific.
This commit is contained in:
@@ -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<void>(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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user