Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regression/cpp/enum1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.cpp
-std=c++11
^EXIT=0$
Expand Down
15 changes: 7 additions & 8 deletions src/cpp/cpp_typecheck_enum_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
bool anonymous=!enum_type.has_tag();
irep_idt base_name;

cpp_save_scopet save_scope(cpp_scopes);

if(anonymous)
{
// we fabricate a tag based on the enum constants contained
Expand All @@ -101,14 +103,11 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
{
const cpp_namet &tag=enum_type.tag();

if(tag.is_simple_name())
base_name=tag.get_base_name();
else
{
error().source_location=type.source_location();
error() << "enum tag is expected to be a simple name" << eom;
throw 0;
}
cpp_template_args_non_tct template_args;
template_args.make_nil();

cpp_typecheck_resolvet resolver(*this);
resolver.resolve_scope(tag, base_name, template_args);
}

bool has_body=enum_type.has_body();
Expand Down