File tree 2 files changed +2
-1
lines changed
2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -1447,7 +1447,7 @@ const Token* findLambdaEndTokenWithoutAST(const Token* tok) {
1447
1447
tok = tok->link ()->next ();
1448
1448
if (Token::simpleMatch (tok, " mutable" ))
1449
1449
tok = tok->next ();
1450
- if (Token::simpleMatch (tok, " ." )) { // trailing return type
1450
+ if (Token::Match (tok, " .|-> " )) { // trailing return type
1451
1451
tok = tok->next ();
1452
1452
while (Token::Match (tok, " %type%|%name%|::|&|&&|*|<|(" )) {
1453
1453
if (tok->link ())
Original file line number Diff line number Diff line change @@ -1764,6 +1764,7 @@ class TestGarbage : public TestFixture {
1764
1764
}
1765
1765
void garbageCode228 () {
1766
1766
ASSERT_NO_THROW (checkCode (" void f() { enum { A = [=]() mutable { return 0; }() }; }" ));
1767
+ ASSERT_NO_THROW (checkCode (" enum { A = [=](void) mutable -> int { return 0; }() };" ));
1767
1768
}
1768
1769
1769
1770
void syntaxErrorFirstToken () {
You can’t perform that action at this time.
0 commit comments