re PR c++/42328 (rejects valid friend)

2015-03-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42328
	* g++.dg/template/friend58.C: New.
	* g++.dg/template/friend59.C: Likewise.

From-SVN: r221751
This commit is contained in:
Paolo Carlini 2015-03-28 10:28:14 +00:00 committed by Paolo Carlini
parent 2894311302
commit f8f40e69b0
3 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2015-03-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/42328
* g++.dg/template/friend58.C: New.
* g++.dg/template/friend59.C: Likewise.
2015-03-27 Tobias Burnus <burnus@net-b.de>
PR c/65586

View File

@ -0,0 +1,19 @@
// PR c++/42328
template<typename T, typename U>
class freeList
{
public:
void foo() {};
};
class bar {};
class baz : protected freeList<bar, baz>
{
template<typename T>
friend
void freeList<T, baz>::foo(); // { dg-error "friend" }
};
baz b;

View File

@ -0,0 +1,22 @@
// PR c++/42328
template<typename T, typename U>
class freeList
{
public:
void foo() {};
};
class bar {};
class baz;
template<typename T> class freeList<T, baz> { void foo(); };
class baz : protected freeList<bar, baz>
{
template<typename T>
friend
void freeList<T, baz>::foo();
};
baz b;