Skip to content

Commit 061a98f

Browse files
committed
Use resolver to translate cpp_name to scoped base_name
1 parent 63acc5b commit 061a98f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

regression/cpp/enum1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.cpp
33
-std=c++11
44
^EXIT=0$

src/cpp/cpp_typecheck_enum_type.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
9191
bool anonymous=!enum_type.has_tag();
9292
irep_idt base_name;
9393

94+
cpp_save_scopet save_scope(cpp_scopes);
95+
9496
if(anonymous)
9597
{
9698
// we fabricate a tag based on the enum constants contained
@@ -100,14 +102,11 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
100102
{
101103
const cpp_namet &tag=enum_type.tag();
102104

103-
if(tag.is_simple_name())
104-
base_name=tag.get_base_name();
105-
else
106-
{
107-
error().source_location=type.source_location();
108-
error() << "enum tag is expected to be a simple name" << eom;
109-
throw 0;
110-
}
105+
cpp_template_args_non_tct template_args;
106+
template_args.make_nil();
107+
108+
cpp_typecheck_resolvet resolver(*this);
109+
resolver.resolve_scope(tag, base_name, template_args);
111110
}
112111

113112
bool has_body=enum_type.has_body();

0 commit comments

Comments
 (0)