Fixed #10079 (AST: switch does not have two operands)
This commit is contained in:
parent
f0005665a8
commit
b8de69489d
|
@ -1383,6 +1383,7 @@ static void createAstAtTokenInner(Token * const tok1, const Token *endToken, boo
|
||||||
if (tok->str() == "(")
|
if (tok->str() == "(")
|
||||||
tok = tok->astOperand1();
|
tok = tok->astOperand1();
|
||||||
const Token * const endToken2 = tok->link();
|
const Token * const endToken2 = tok->link();
|
||||||
|
tok = tok->next();
|
||||||
for (; tok && tok != endToken && tok != endToken2; tok = tok ? tok->next() : nullptr)
|
for (; tok && tok != endToken && tok != endToken2; tok = tok ? tok->next() : nullptr)
|
||||||
tok = createAstAtToken(tok, cpp);
|
tok = createAstAtToken(tok, cpp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6011,6 +6011,13 @@ private:
|
||||||
|
|
||||||
// #9729
|
// #9729
|
||||||
ASSERT_NO_THROW(tokenizeAndStringify("void foo() { bar([]() noexcept { if (0) {} }); }"));
|
ASSERT_NO_THROW(tokenizeAndStringify("void foo() { bar([]() noexcept { if (0) {} }); }"));
|
||||||
|
|
||||||
|
// #10079 - createInnerAST bug..
|
||||||
|
ASSERT_EQUALS("x{([= yz= switchy(",
|
||||||
|
testAst("x = []() -> std::vector<uint8_t> {\n"
|
||||||
|
" const auto y = z;\n"
|
||||||
|
" switch (y) {}\n"
|
||||||
|
"};"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void astcase() {
|
void astcase() {
|
||||||
|
|
Loading…
Reference in New Issue