diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index 4bb9d9f76..d2865d9f4 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -50,7 +50,8 @@ namespace { //--------------------------------------------------------------------------- -static bool isSizeOfEtc(const Token *tok) { +static bool isSizeOfEtc(const Token *tok) +{ return Token::Match(tok, "sizeof|typeof|offsetof|decltype|__typeof__ ("); } @@ -1530,7 +1531,7 @@ void CheckUninitVar::valueFlowUninit() if (ispointer && v->indirect == 1 && !deref) continue; if (isarray && !deref) - continue; + continue; uninitderef = deref && v->indirect == 0; const bool isleaf = isLeafDot(tok) || uninitderef; if (Token::Match(tok->astParent(), ". %var%") && !isleaf) diff --git a/lib/forwardanalyzer.cpp b/lib/forwardanalyzer.cpp index 7f078a333..ecc6d4573 100644 --- a/lib/forwardanalyzer.cpp +++ b/lib/forwardanalyzer.cpp @@ -111,7 +111,7 @@ struct ForwardTraversal { return Progress::Skip; T* firstOp = tok->astOperand1(); T* secondOp = tok->astOperand2(); - // Evaluate: + // Evaluate: // 1. RHS of assignment before LHS // 2. Unary op before operand if (tok->isAssignmentOp() || !secondOp) diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index ff8009a5f..bbb571f32 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -5119,8 +5119,8 @@ private: tok("template struct A { T x; };\n" "A y;")); - // Previously resulted in: - // test.cpp:2:33: error: Syntax Error: AST broken, binary operator '>' doesn't have two operands. [internalAstError] + // Previously resulted in: + // test.cpp:2:33: error: Syntax Error: AST broken, binary operator '>' doesn't have two operands. [internalAstError] ASSERT_EQUALS("struct A[]> ; " "struct B> ; " "struct C> ; "