Fixed #9729 (AST: lambda with noexcept)
This commit is contained in:
parent
ac1ceb85b6
commit
43b58dbc9e
|
@ -906,7 +906,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();
|
||||
if (Token::Match(curlyBracket, "mutable|const"))
|
||||
if (Token::Match(curlyBracket, "mutable|const|noexcept"))
|
||||
curlyBracket = curlyBracket->next();
|
||||
if (curlyBracket && curlyBracket->originalName() == "->") {
|
||||
curlyBracket = findTypeEnd(curlyBracket->next());
|
||||
|
|
|
@ -7852,9 +7852,14 @@ private:
|
|||
// [
|
||||
// `-(
|
||||
// `-{
|
||||
ASSERT_EQUALS("x{([( ai=", testAst("x([&a](int i){a=i;});"));
|
||||
|
||||
ASSERT_EQUALS("x{([( ai=", testAst("x([&a](int i){a=i;});"));
|
||||
ASSERT_EQUALS("{([(return 0return", testAst("return [](){ return 0; }();"));
|
||||
|
||||
// noexcept
|
||||
ASSERT_EQUALS("x{([( ai=", testAst("x([](int i)noexcept{a=i;});"));
|
||||
|
||||
// ->
|
||||
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);"));
|
||||
|
|
Loading…
Reference in New Issue