diff options
author | Brad King <brad.king@kitware.com> | 2019-08-23 14:03:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-23 14:03:57 (GMT) |
commit | 7f2bb732fc2b684f5b36c522d75ae50faaabab45 (patch) | |
tree | cca3f50e8efed9a8997d95d1e9f3b26948500a3e /Source/cmExprParserHelper.cxx | |
parent | 68126f5a02b7d21b0d632b9e2c63687b71b3f5fa (diff) | |
parent | 9b334397f55b70689ff1d8f7d6767a34834e85b6 (diff) | |
download | CMake-7f2bb732fc2b684f5b36c522d75ae50faaabab45.zip CMake-7f2bb732fc2b684f5b36c522d75ae50faaabab45.tar.gz CMake-7f2bb732fc2b684f5b36c522d75ae50faaabab45.tar.bz2 |
Merge topic 'source_sweep_cmStrCat'
9b334397f5 Source sweep: Use cmStrCat for string concatenation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Rolf Eike Beer <eike@sf-mail.de>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3699
Diffstat (limited to 'Source/cmExprParserHelper.cxx')
-rw-r--r-- | Source/cmExprParserHelper.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index 80c78a3..c01e959 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -3,6 +3,7 @@ #include "cmExprParserHelper.h" #include "cmExprLexer.h" +#include "cmStringAlgorithms.h" #include <iostream> #include <sstream> @@ -41,16 +42,13 @@ int cmExprParserHelper::ParseString(const char* str, int verb) try { int res = cmExpr_yyparse(yyscanner); if (res != 0) { - std::string e = "cannot parse the expression: \"" + InputBuffer + "\": "; - e += ErrorString; - e += "."; + std::string e = cmStrCat("cannot parse the expression: \"", InputBuffer, + "\": ", ErrorString, '.'); this->SetError(std::move(e)); } } catch (std::runtime_error const& fail) { - std::string e = - "cannot evaluate the expression: \"" + InputBuffer + "\": "; - e += fail.what(); - e += "."; + std::string e = cmStrCat("cannot evaluate the expression: \"", InputBuffer, + "\": ", fail.what(), '.'); this->SetError(std::move(e)); } catch (std::out_of_range const&) { std::string e = "cannot evaluate the expression: \"" + InputBuffer + |