Skip to content

Commit 5fa2df7

Browse files
committed
C++ front-end: enum attributes and multiple attributes
Clang's standard library includes enum member attributes and uses of `__attribute__((...)) __attribute__((...))` rather than combining multiple attributes via a comma between them.
1 parent 5236e6f commit 5fa2df7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cpp/parse.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ bool Parser::rGCCAttribute(typet &t)
24582458

24592459
bool Parser::optAttribute(typet &t)
24602460
{
2461-
if(lex.LookAhead(0) == TOK_GCC_ATTRIBUTE)
2461+
while(lex.LookAhead(0) == TOK_GCC_ATTRIBUTE)
24622462
{
24632463
lex.get_token();
24642464

@@ -4627,6 +4627,10 @@ bool Parser::rEnumBody(irept &body)
46274627
set_location(n, tk);
46284628
n.set(ID_name, tk.data.get(ID_C_base_name));
46294629

4630+
typet discarded_attribute;
4631+
if(!optAttribute(discarded_attribute))
4632+
return false;
4633+
46304634
if(lex.LookAhead(0, tk2)=='=') // set the constant
46314635
{
46324636
lex.get_token(tk2); // read the '='

0 commit comments

Comments
 (0)