re PR c++/70522 (Hidden friend functions block qualified name lookup into nested unnamed namespace)

PR c++/70522

	* name-lookup.c (qualified_lookup_using_namespace): Look through
	hidden names.

From-SVN: r235206
This commit is contained in:
Jason Merrill 2016-04-19 09:40:03 -04:00 committed by Jason Merrill
parent a017690335
commit 3ba065e89e
3 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-04-19 Jason Merrill <jason@redhat.com>
PR c++/70522
* name-lookup.c (qualified_lookup_using_namespace): Look through
hidden names.
2016-04-18 Michael Matz <matz@suse.de>
* class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.

View File

@ -4647,8 +4647,9 @@ qualified_lookup_using_namespace (tree name, tree scope,
cp_binding_level_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
if (binding)
{
found_here = true;
ambiguous_decl (result, binding, flags);
if (result->type || result->value)
found_here = true;
}
for (usings = DECL_NAMESPACE_USING (scope); usings;

View File

@ -0,0 +1,15 @@
// PR c++/70522
namespace A {
struct C {
friend void i();
};
namespace {
int i;
}
}
int main()
{
return A::i;
}