commit 995a41f6f9153cbc4ec713ec645a3edebc408ec2
Author: Jason Merrill <jason@redhat.com>
Date: Tue Apr 19 09:11:38 2016 -0400
PR c++/70522
* name-lookup.c (qualified_lookup_using_namespace): Look through
hidden names.
@@ -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;
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/70522
+
+namespace A {
+ struct C {
+ friend void i();
+ };
+ namespace {
+ int i;
+ }
+}
+
+int main()
+{
+ return A::i;
+}