diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-19 13:40:03 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-19 13:40:03 +0000 |
commit | cbcbdb5418545f88fd21f6524705b078e78f5dcb (patch) | |
tree | 2a1ed2d29ebae5af4871ef305903eed37779c353 | |
parent | 544c4d8e35d593899f9121206b941c53ffcfe088 (diff) | |
download | gcc-cbcbdb5418545f88fd21f6524705b078e78f5dcb.tar.gz |
PR c++/70522
* name-lookup.c (qualified_lookup_using_namespace): Look through
hidden names.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235206 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/friend18.C | 15 |
3 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c50c6abd616..056e91740c0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 89d84d7b1c3..b3828c0956b 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -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; diff --git a/gcc/testsuite/g++.dg/lookup/friend18.C b/gcc/testsuite/g++.dg/lookup/friend18.C new file mode 100644 index 00000000000..90cd2d75dc7 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/friend18.C @@ -0,0 +1,15 @@ +// PR c++/70522 + +namespace A { + struct C { + friend void i(); + }; + namespace { + int i; + } +} + +int main() +{ + return A::i; +} |