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.