astyle formatting

This commit is contained in:
Daniel Marjamäki 2021-05-23 14:36:45 +02:00
parent 8828619855
commit d64aea90fa
3 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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)

View File

@ -5119,8 +5119,8 @@ private:
tok("template <class T> struct A { T x; };\n"
"A<int[2]> 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<B<int>[]> ; "
"struct B<B<int>> ; "
"struct C<B<int>> ; "