diff --git a/.clang-tidy b/.clang-tidy index f4d50f4b..06fe2fd9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,6 +8,7 @@ Checks: '*include*, bugprone-narrowing-conversions, bugprone-switch-missing-default-case, cert-err33-c, + readability-suspicious-call-argument, readability-isolate-declaration, readability-redundant-member-init, readability-named-parameter, diff --git a/src/compiler/Parser.cpp b/src/compiler/Parser.cpp index ee3c6e19..1024b32c 100644 --- a/src/compiler/Parser.cpp +++ b/src/compiler/Parser.cpp @@ -919,11 +919,11 @@ __attribute__((noreturn)) void Parser::parseError(const char* msg, std::string msgWithMeta = "%(file)s:%(line)d:%(column)d: error: " + std::string(msg); - std::string foundStr; + std::string found; if (_PRINTABLE_SYM) { - foundStr = symnames[sym] + std::string(" (") + text + ")"; + found = symnames[sym] + std::string(" (") + text + ")"; } else { - foundStr = symnames[sym]; + found = symnames[sym]; } ReplacePattern(msgWithMeta, "%(file)s", fname); @@ -934,7 +934,7 @@ __attribute__((noreturn)) void Parser::parseError(const char* msg, std::string column = std::to_string(lexer.GetCurrentColumn()); ReplacePattern(msgWithMeta, "%(column)d", column); ReplacePattern(msgWithMeta, "%(expected)s", expected); - ReplacePattern(msgWithMeta, "%(found)s", foundStr); + ReplacePattern(msgWithMeta, "%(found)s", found); ErrorPrint(msgWithMeta); Quit(ERR_FAIL);