Properly set up scope prefix instead of hacking it away
This commit is contained in:
parent
4c0915f925
commit
aa40d591d1
|
@ -165,10 +165,9 @@ const symbolt &cpp_typecheckt::class_template_symbol(
|
|||
INVARIANT_STRUCTURED(
|
||||
template_scope!=nullptr, nullptr_exceptiont, "template_scope is null");
|
||||
|
||||
irep_idt identifier=
|
||||
id2string(template_scope->prefix)+
|
||||
"tag-"+id2string(template_symbol.base_name)+
|
||||
id2string(suffix);
|
||||
irep_idt identifier = id2string(template_scope->get_parent().prefix) +
|
||||
"tag-" + id2string(template_symbol.base_name) +
|
||||
id2string(suffix);
|
||||
|
||||
// already there?
|
||||
symbol_tablet::symbolst::const_iterator s_it=
|
||||
|
@ -205,9 +204,8 @@ const symbolt &cpp_typecheckt::class_template_symbol(
|
|||
|
||||
id.id_class=cpp_idt::id_classt::CLASS;
|
||||
id.is_scope=true;
|
||||
id.prefix=template_scope->prefix+
|
||||
id2string(s_ptr->base_name)+
|
||||
id2string(suffix)+"::";
|
||||
id.prefix = template_scope->get_parent().prefix +
|
||||
id2string(s_ptr->base_name) + id2string(suffix) + "::";
|
||||
id.class_identifier=s_ptr->name;
|
||||
id.id_class=cpp_idt::id_classt::CLASS;
|
||||
|
||||
|
|
|
@ -719,11 +719,7 @@ cpp_scopet &cpp_typecheckt::typecheck_template_parameters(
|
|||
std::string id_suffix="template::"+std::to_string(template_counter++);
|
||||
|
||||
// produce a new scope for the template parameters
|
||||
cpp_scopet &template_scope=
|
||||
cpp_scopes.current_scope().new_scope(
|
||||
cpp_scopes.current_scope().prefix+id_suffix);
|
||||
|
||||
template_scope.prefix=template_scope.get_parent().prefix+id_suffix;
|
||||
cpp_scopet &template_scope = cpp_scopes.current_scope().new_scope(id_suffix);
|
||||
template_scope.id_class=cpp_idt::id_classt::TEMPLATE_SCOPE;
|
||||
|
||||
cpp_scopes.go_to(template_scope);
|
||||
|
@ -826,9 +822,6 @@ cpp_scopet &cpp_typecheckt::typecheck_template_parameters(
|
|||
#endif
|
||||
}
|
||||
|
||||
// continue without adding to the prefix
|
||||
template_scope.prefix=template_scope.get_parent().prefix;
|
||||
|
||||
return template_scope;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue