File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ static bool isClassStructUnionEnumStart(const Token * tok)
110110 const Token * tok2 = tok->previous ();
111111 while (tok2 && !Token::Match (tok2, " class|struct|union|enum|{|}|)|;|>|>>" ))
112112 tok2 = tok2->previous ();
113- return Token::Match (tok2, " class|struct|union|enum" );
113+ return Token::Match (tok2, " class|struct|union|enum" ) && ! Token::simpleMatch (tok2-> tokAt (- 1 ), " -> " ) ;
114114}
115115
116116// ---------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -7683,6 +7683,12 @@ class TestTokenizer : public TestFixture {
76837683
76847684 ASSERT_NO_THROW (tokenizeAndStringify (" struct S { unsigned u:2, :30; };" )); // #14393
76857685
7686+ ASSERT_NO_THROW (tokenizeAndStringify (" struct S {};\n " // #14400
7687+ " auto f(bool b) -> struct S {\n "
7688+ " if (b) {}\n "
7689+ " return {};\n "
7690+ " };\n " ));
7691+
76867692 ignore_errout ();
76877693 }
76887694
You can’t perform that action at this time.
0 commit comments