File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -572,12 +572,12 @@ namespace {
572572 ++nBraces;
573573 else if (tok->str () == " }" )
574574 --nBraces;
575+ if (nBraces > 0 )
576+ continue ;
575577 if (tok == mNameToken )
576578 continue ;
577579 if (tok->str () != mNameToken ->str ())
578580 continue ;
579- if (nBraces > 0 && Token::Match (tok->next (), " [;(]" ))
580- continue ;
581581 if (Token::Match (tok->previous (), " struct|class|enum|union" ))
582582 continue ;
583583 throw InternalError (tok, " recursive typedef encountered" );
Original file line number Diff line number Diff line change @@ -3887,6 +3887,9 @@ class TestSimplifyTypedef : public TestFixture {
38873887
38883888 const char code3[] = " typedef struct S { S() {} } S;" ; // #14971
38893889 ASSERT_EQUALS (" struct S { S ( ) { } } ;" , tok (code3));
3890+
3891+ const char code4[] = " typedef struct S { S& operator=(const S&) = delete; } S;" ; // #14977
3892+ ASSERT_EQUALS (" struct S { S & operator= ( const S & ) = delete ; } ;" , tok (code4));
38903893 }
38913894
38923895 void simplifyTypedefFunction1 () {
You can’t perform that action at this time.
0 commit comments