From: Mikko Rasa Date: Mon, 26 Dec 2022 19:01:30 +0000 (+0200) Subject: Add a sanity check for derived tool commands X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;ds=sidebyside;h=4e220a1ec5800e2f1caba02d55977a3b6f68d112;p=builder.git Add a sanity check for derived tool commands It doesn't seem correct to copy the command in CustomizedTool, since often the derived class will want to use a different command anyway. --- diff --git a/source/tool.cpp b/source/tool.cpp index 82349e1..eaf4977 100644 --- a/source/tool.cpp +++ b/source/tool.cpp @@ -59,6 +59,9 @@ void Tool::prepare(Tool &tool) const if(&tool!=this && tool.get_base_tool()!=this) throw invalid_argument("Tool::prepare"); + if(&tool!=this && !command.empty() && tool.command.empty()) + throw logic_error("Derived tool has no command"); + do_prepare(tool); }