Fixed #8001 (AST: Wrong AST for lambda function with 'std::string const&' result type)
This commit is contained in:
parent
82a68858ef
commit
7a26e046a8
|
@ -697,7 +697,7 @@ static void compilePrecedence2(Token *&tok, AST_state& state)
|
|||
if (Token::simpleMatch(squareBracket->link(), "] (")) {
|
||||
Token* const roundBracket = squareBracket->link()->next();
|
||||
Token* curlyBracket = roundBracket->link()->next();
|
||||
while (Token::Match(curlyBracket, "%name%|.|::"))
|
||||
while (Token::Match(curlyBracket, "%name%|.|::|&"))
|
||||
curlyBracket = curlyBracket->next();
|
||||
if (curlyBracket && curlyBracket->str() == "{") {
|
||||
squareBracket->astOperand1(roundBracket);
|
||||
|
|
|
@ -8178,6 +8178,7 @@ private:
|
|||
ASSERT_EQUALS("{([(return 0return", testAst("return []() -> int { return 0; }();"));
|
||||
ASSERT_EQUALS("{([(return 0return", testAst("return [something]() -> int { return 0; }();"));
|
||||
ASSERT_EQUALS("{([cd,(return 0return", testAst("return [](int a, int b) -> int { return 0; }(c, d);"));
|
||||
TODO_ASSERT_EQUALS("x{([=", "stdconst::x{([=&", testAst("x = [&]()->std::string const & { 1; }"));
|
||||
|
||||
ASSERT_EQUALS("x{([= 0return", testAst("x = [](){return 0; };"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue