summaryrefslogtreecommitdiff
path: root/Source/cmFunctionBlocker.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-07-30 22:58:40 +0200
committerRegina Pfeifer <regina@mailbox.org>2019-07-31 00:03:17 +0200
commit6491270e0d3699f5151c08ef41dce84724f9ffc1 (patch)
treef4caa3b0bc5262e73352394a4bb0ed534a765133 /Source/cmFunctionBlocker.cxx
parentaf24e4ef6e216184b8c207728d6b0312ce3c1525 (diff)
downloadcmake-6491270e0d3699f5151c08ef41dce84724f9ffc1.tar.gz
cmFunctionBlocker: Move check for matching args
Diffstat (limited to 'Source/cmFunctionBlocker.cxx')
-rw-r--r--Source/cmFunctionBlocker.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmFunctionBlocker.cxx b/Source/cmFunctionBlocker.cxx
index 29996916a6..437d4b5c31 100644
--- a/Source/cmFunctionBlocker.cxx
+++ b/Source/cmFunctionBlocker.cxx
@@ -2,8 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFunctionBlocker.h"
+#include <cassert>
+#include <sstream>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
bool cmFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
cmExecutionStatus& status)
@@ -14,7 +18,24 @@ bool cmFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
this->ScopeDepth--;
if (this->ScopeDepth == 0U) {
cmMakefile& mf = status.GetMakefile();
- auto self = mf.RemoveFunctionBlocker(this, lff);
+ auto self = mf.RemoveFunctionBlocker();
+ assert(self.get() == this);
+
+ if (!this->ArgumentsMatch(lff, mf)) {
+ cmListFileContext const& lfc = this->GetStartingContext();
+ cmListFileContext closingContext =
+ cmListFileContext::FromCommandContext(lff, lfc.FilePath);
+ std::ostringstream e;
+ /* clang-format off */
+ e << "A logical block opening on the line\n"
+ << " " << lfc << "\n"
+ << "closes on the line\n"
+ << " " << closingContext << "\n"
+ << "with mis-matching arguments.";
+ /* clang-format on */
+ mf.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
+ }
+
return this->Replay(this->Functions, status);
}
}