From: jason Date: Mon, 7 Dec 2015 19:34:04 +0000 (+0000) Subject: PR c++/68170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd913aed41b7534484dfeed4077ed3b30e792528;p=thirdparty%2Fgcc.git PR c++/68170 * pt.c (maybe_new_partial_specialization): The injected-class-name is not a new partial specialization. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231380 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7381a7562785..7c045e3ab269 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2015-12-07 Jason Merrill + PR c++/68170 + * pt.c (maybe_new_partial_specialization): The injected-class-name + is not a new partial specialization. + * Make-lang.in (check-c++1z, check-c++-all): Use GXX_TESTSUITE_STDS. 2015-12-06 Jason Merrill diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 22dcee281ba5..60cc94c2aac4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -855,6 +855,10 @@ maybe_new_partial_specialization (tree type) if (!current_template_parms) return NULL_TREE; + // The injected-class-name is not a new partial specialization. + if (DECL_SELF_REFERENCE_P (TYPE_NAME (type))) + return NULL_TREE; + // If the constraints are not the same as those of the primary // then, we can probably create a new specialization. tree type_constr = current_template_constraints (); diff --git a/gcc/testsuite/g++.dg/template/friend60.C b/gcc/testsuite/g++.dg/template/friend60.C new file mode 100644 index 000000000000..5ba9ab2f4022 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend60.C @@ -0,0 +1,13 @@ +// PR c++/68170 + +template< typename T > +class A +{ +}; + +template<> +class A< void > +{ + template< typename X > + friend class A; +};