[PR c++/59930] template friend injection
authorNathan Sidwell <nathan@acm.org>
Mon, 18 Dec 2017 16:30:58 +0000 (16:30 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 18 Dec 2017 16:30:58 +0000 (16:30 +0000)
commit02c7dd78fa0a3d05231f6340c4cc80d91b2393a5
tree1a40cb991e3f50f1695706c2af98c080c525658a
parent0cf0bc67f6fad8653edb7656080f7f61394c92b4
[PR c++/59930] template friend injection

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01168.html
PR c++/59930
* name-lookup.c (name_lookup::search_unqualified): Don't search
parent namespace when looking for hidden things.
* pt.c (tsubst_friend_class): Always push to friend scope, drop
unneeded self-friend check. Inject new hidden friend into correct
scope.

PR c++/59930
* g++.dg/parse/pr81247-c.C: Adjust.
* g++.dg/template/pr59930-[123].C: New.

From-SVN: r255780
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/pr81247-c.C
gcc/testsuite/g++.dg/template/pr59930-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/pr59930-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/pr59930-3.C [new file with mode: 0644]