From 2c4a7298fcb3ac6a6b6c0a9545b343c814f3d6ec Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 11 Feb 2015 20:23:36 +0100 Subject: cmMacroCommand: Declare arg in the scope that it is used. It can make sense to declare objects outside of loops if the size required by the object can grow (eg std::string when using getline), but that is not the case here. --- Source/cmMacroCommand.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 6f45484..bd53b1e 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -85,7 +85,6 @@ bool cmMacroHelperCommand::InvokeInitialPass this->Makefile->ExpandArguments(args, expandedArgs); std::string tmps; - cmListFileArgument arg; // make sure the number of arguments passed is at least the number // required by the signature @@ -144,6 +143,8 @@ bool cmMacroHelperCommand::InvokeInitialPass // Set the FilePath on the arguments to match the function since it is // not stored and the original values may be freed k->FilePath = this->FilePath.c_str(); + + cmListFileArgument arg; if(k->Delim == cmListFileArgument::Bracket) { arg.Value = k->Value; -- cgit v0.12