Fixed setVarId on ternary operator in initialization list
This commit is contained in:
parent
bae95b4560
commit
f04070940e
|
@ -2491,7 +2491,7 @@ static void setVarIdClassDeclaration(Token * const startToken,
|
||||||
setVarIdStructMembers(&tok, structMembers, _varId);
|
setVarIdStructMembers(&tok, structMembers, _varId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (indentlevel == 0 && tok->str() == ":")
|
} else if (indentlevel == 0 && tok->str() == ":" && !initListEndToken)
|
||||||
initListEndToken = findInitListEndToken(tok->previous());
|
initListEndToken = findInitListEndToken(tok->previous());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1655,6 +1655,18 @@ private:
|
||||||
"3: int x@2 ;\n"
|
"3: int x@2 ;\n"
|
||||||
"4: } ;\n",
|
"4: } ;\n",
|
||||||
tokenize(code6));
|
tokenize(code6));
|
||||||
|
|
||||||
|
// #6520
|
||||||
|
const char code7[] = "class A {\n"
|
||||||
|
" A(int x) : y(a?0:1), x(x) {}\n"
|
||||||
|
" int x, y;\n"
|
||||||
|
"};";
|
||||||
|
ASSERT_EQUALS("\n\n##file 0\n"
|
||||||
|
"1: class A {\n"
|
||||||
|
"2: A ( int x@1 ) : y@3 ( a ? 0 : 1 ) , x@2 ( x@1 ) { }\n"
|
||||||
|
"3: int x@2 ; int y@3 ;\n"
|
||||||
|
"4: } ;\n",
|
||||||
|
tokenize(code7));
|
||||||
}
|
}
|
||||||
|
|
||||||
void varid_operator() {
|
void varid_operator() {
|
||||||
|
|
Loading…
Reference in New Issue