Make decl_base::set_scope virtual, to work on class_decl::member_type

* include/abg-ir.h (decl_base::set_scope): Make this virtual.
	(class_decl::member_type::set_scope): Declare an overload here.
	* src/abg-ir.cc (class_decl::member_type::set_scope): Define new
	overload.  Make this set the scope of the underlying type of the
	member type as well.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2013-12-20 16:14:21 +01:00
parent 118a5df30d
commit f47b1ffd6d
2 changed files with 15 additions and 1 deletions

View File

@ -198,7 +198,7 @@ private:
// Forbidden
decl_base();
void
virtual void
set_scope(scope_decl*);
public:
@ -1750,6 +1750,9 @@ public:
member_type(shared_ptr<type_base> t, access_specifier access);
virtual void
set_scope(scope_decl*);
virtual bool
operator==(const decl_base&) const;

View File

@ -3037,6 +3037,17 @@ class_decl::member_type::member_type(shared_ptr<type_base> t,
member_base(access), type_(t)
{}
/// Set the scope of a member type.
///
/// @param scope the new scope to set.
void
class_decl::member_type::set_scope(scope_decl* scope)
{
decl_base::context_ = scope;
decl_base_sptr td = get_type_declaration(as_type());
td->set_scope(scope);
}
bool
class_decl::member_type::operator==(const decl_base& other) const
{