]> sourceware.org Git - libabigail.git/commit
Make decl_base::get_qualified_name() work when decl context changes
authorDodji Seketeli <dodji@redhat.com>
Wed, 19 Aug 2015 10:06:24 +0000 (12:06 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 19 Aug 2015 16:09:29 +0000 (18:09 +0200)
commit39b2e8b7d58681fde3ce6d845c7447a547e1c7a1
treef951a21cc74162736e64e34e044337c398e84640
parentba5b4452d54caf22fb1d0e847d69eef3745ea91d
Make decl_base::get_qualified_name() work when decl context changes

decl_base::get_qualified_name() caches its result.  So when it's
first called on a decl that is not added to a scope, what is returned
is a non-qualified name.  Which is all right.  But then when the decl
is later added to a scope, the cached result of
decl_base::get_qualified_name() is not longer correct.

This patch resets the cache of decl_base::get_qualified_name() when
the decl gets added to a new scope.

* include/abg-ir.h (class decl_base): Make class scope_decl a
friend of decl_base.
(type_base::priv_): Make this protected, rather than private.
* src/abg-ir.cc (scope_decl::add_member_decl)
(scope_decl::insert_member_decl): Reset the cache of the result of
decl_base::get_qualified_name().
* tests/data/test-abidiff/test-PR18791-report0.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ir.h
src/abg-ir.cc
tests/data/test-abidiff/test-PR18791-report0.txt
This page took 0.033896 seconds and 5 git commands to generate.