diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 19d9fbc76..5ad0726f8 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2825,7 +2825,7 @@ static bool isVariableExpression(const Token* tok) if (Token::Match(tok, "%var%")) return true; if (Token::simpleMatch(tok, ".")) - return isVariableExpression(tok->astOperand1()) && + return isVariableExpression(tok->astOperand1()) && isVariableExpression(tok->astOperand2()); return false; } diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 58784adf5..358e78aec 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7779,7 +7779,7 @@ bool Tokenizer::simplifyRedundantParentheses() if (tok->str() != "(") continue; - if (isCPP() && Token::simpleMatch(tok->previous(), "} (") && + if (isCPP() && Token::simpleMatch(tok->previous(), "} (") && Token::Match(tok->previous()->link()->previous(), "%name%|> {")) continue; diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index ffaace99b..f0dc7f87c 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -289,13 +289,13 @@ private: void cpp11init3() { check("struct A { void operator()(int); };\n" "void f() {\n" - "A{}(0);\n" + "A{}(0);\n" "}\n"); ASSERT_EQUALS("", errout.str()); check("template struct A { void operator()(int); };\n" "void f() {\n" - "A{}(0);\n" + "A{}(0);\n" "}\n"); ASSERT_EQUALS("", errout.str()); } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index cd76d1444..786b9ecc3 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7662,7 +7662,7 @@ private: "template using c = int;\n" "template c d;\n" "template <> struct a {\n" - "template constexpr auto g() { d<0 || e::f>; return 0; }\n" + "template constexpr auto g() { d<0 || e::f>; return 0; }\n" "};\n")) }