Skip to content

Commit cf9442c

Browse files
committed
Parse C++11 enums with type specifier
Manual cherry-pick of geany/geany@f2f22d3
1 parent ce27db2 commit cf9442c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

c.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,6 +2528,15 @@ static void processColon (statementInfo *const st)
25282528
else if (c == ';')
25292529
setToken (st, TOKEN_SEMICOLON);
25302530
}
2531+
else if (isLanguage (Lang_cpp) && st->declaration == DECL_ENUM)
2532+
{
2533+
/* skip enum's base type */
2534+
c = skipToOneOf ("{;");
2535+
if (c == '{')
2536+
setToken (st, TOKEN_BRACE_OPEN);
2537+
else if (c == ';')
2538+
setToken (st, TOKEN_SEMICOLON);
2539+
}
25312540
else
25322541
{
25332542
const tokenInfo *const prev = prevToken (st, 1);

0 commit comments

Comments
 (0)