File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1389,9 +1389,25 @@ bool Parser::parseEnumSpecifier(TypeSpecifierAST *&node)
1389
1389
1390
1390
CHECK (Token_enum);
1391
1391
1392
+ if (token_stream.lookAhead () == Token_class)
1393
+ {
1394
+ token_stream.nextToken ();
1395
+ }
1396
+
1392
1397
NameAST *name = 0 ;
1393
1398
parseName (name);
1394
1399
1400
+ if (token_stream.lookAhead () == ' :' )
1401
+ {
1402
+ token_stream.nextToken ();
1403
+ TypeSpecifierAST *ast = 0 ;
1404
+ if (!parseSimpleTypeSpecifier (ast))
1405
+ {
1406
+ token_stream.rewind ((int ) start);
1407
+ return false ;
1408
+ }
1409
+ }
1410
+
1395
1411
if (token_stream.lookAhead () != ' {' )
1396
1412
{
1397
1413
token_stream.rewind ((int ) start);
@@ -1796,12 +1812,17 @@ bool Parser::parseForwardDeclarationSpecifier(TypeSpecifierAST *&node)
1796
1812
std::size_t start = token_stream.cursor ();
1797
1813
1798
1814
int kind = token_stream.lookAhead ();
1799
- if (kind != Token_class && kind != Token_struct && kind != Token_union)
1815
+ if (kind != Token_class && kind != Token_struct && kind != Token_union && kind != Token_enum )
1800
1816
return false ;
1801
1817
1802
1818
std::size_t class_key = token_stream.cursor ();
1803
1819
token_stream.nextToken ();
1804
1820
1821
+ if (kind == Token_enum && token_stream.lookAhead () == Token_class)
1822
+ {
1823
+ token_stream.nextToken ();
1824
+ }
1825
+
1805
1826
NameAST *name = 0 ;
1806
1827
if (!parseName (name, false )) {
1807
1828
token_stream.rewind ((int ) start);
You can’t perform that action at this time.
0 commit comments