File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -8837,6 +8837,8 @@ void Tokenizer::findGarbageCode() const
88378837 if (tok->str () == " ;" ) { // do the counting
88388838 semicolons++;
88398839 } else if (tok->str () == " :" ) {
8840+ if (tok->strAt (-1 ) == " ," )
8841+ syntaxError (tok);
88408842 colons++;
88418843 } else if (tok->str () == " )" ) { // skip pairs of ( )
88428844 tok = tok->link ();
@@ -8960,8 +8962,6 @@ void Tokenizer::findGarbageCode() const
89608962 syntaxError (tok);
89618963 if (Token::Match (tok, " : [)]=]" ))
89628964 syntaxError (tok);
8963- if (Token::simpleMatch (tok, " , :" ))
8964- syntaxError (tok);
89658965 if (Token::Match (tok, " typedef [,;:]" ))
89668966 syntaxError (tok);
89678967 if (Token::Match (tok, " ? %assign%" ))
Original file line number Diff line number Diff line change @@ -7681,6 +7681,8 @@ class TestTokenizer : public TestFixture {
76817681
76827682 ASSERT_NO_THROW (tokenizeAndStringify (" enum { E = sizeof(struct { int i; }) };" )); // #13249
76837683
7684+ ASSERT_NO_THROW (tokenizeAndStringify (" struct S { unsigned u:2, :30; };" )); // #14393
7685+
76847686 ignore_errout ();
76857687 }
76867688
You can’t perform that action at this time.
0 commit comments