https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59956
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Fri Aug 1 18:33:47 2014 New Revision: 213501 URL: https://gcc.gnu.org/viewcvs?rev=213501&root=gcc&view=rev Log: PR c++/59956 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we have a friend template in a class template. * pt.c (tsubst_friend_function): Look through it. (push_template_decl_real): A friend member template is primary. Added: branches/gcc-4_8-branch/gcc/testsuite/g++.dg/template/friend55.C Modified: branches/gcc-4_8-branch/gcc/cp/ChangeLog branches/gcc-4_8-branch/gcc/cp/friend.c branches/gcc-4_8-branch/gcc/cp/pt.c