File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
regression/cpp/enum_class1 Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,7 @@ int main()
1414{
1515 Color1 c;
1616 c=Color1::red;
17+
18+ Color2 c2;
19+ c2 = red;
1720}
Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22main.cpp
33-std=c++11
44^EXIT=0$
Original file line number Diff line number Diff line change @@ -193,6 +193,12 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
193193 cpp_scopes.put_into_scope (*new_symbol, dest_scope);
194194
195195 scope_identifier.id_class =cpp_idt::id_classt::CLASS;
196+ scope_identifier.is_scope = true ;
197+
198+ cpp_save_scopet save_scope (cpp_scopes);
199+
200+ if (new_symbol->type .get_bool (ID_C_class))
201+ cpp_scopes.go_to (scope_identifier);
196202
197203 typecheck_enum_body (*new_symbol);
198204 }
Original file line number Diff line number Diff line change @@ -4039,7 +4039,6 @@ bool Parser::rEnumSpec(typet &spec)
40394039 #endif
40404040
40414041 cpp_tokent tk;
4042- // bool is_enum_class=false;
40434042
40444043 if (lex.get_token (tk)!=TOK_ENUM)
40454044 return false ;
@@ -4053,7 +4052,7 @@ bool Parser::rEnumSpec(typet &spec)
40534052 if (lex.LookAhead (0 )==TOK_CLASS)
40544053 {
40554054 lex.get_token (tk);
4056- // is_enum_class= true;
4055+ spec. set (ID_C_class, true ) ;
40574056 }
40584057
40594058 if (lex.LookAhead (0 )!=' {' &&
You can’t perform that action at this time.
0 commit comments