Skip to content

Commit

Permalink
Use resolver to translate cpp_name to scoped base_name
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jun 9, 2018
1 parent 63acc5b commit 061a98f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
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 @@ -91,6 +91,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 @@ -100,14 +102,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

0 comments on commit 061a98f

Please sign in to comment.