From f8f40e69b056bcd73c1e44e69dd1109f2ff1c1be Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sat, 28 Mar 2015 10:28:14 +0000 Subject: [PATCH] re PR c++/42328 (rejects valid friend) 2015-03-28 Paolo Carlini PR c++/42328 * g++.dg/template/friend58.C: New. * g++.dg/template/friend59.C: Likewise. From-SVN: r221751 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/template/friend58.C | 19 +++++++++++++++++++ gcc/testsuite/g++.dg/template/friend59.C | 22 ++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/friend58.C create mode 100644 gcc/testsuite/g++.dg/template/friend59.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d94f5a12b53..0e4c56cf8ad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-03-28 Paolo Carlini + + PR c++/42328 + * g++.dg/template/friend58.C: New. + * g++.dg/template/friend59.C: Likewise. + 2015-03-27 Tobias Burnus PR c/65586 diff --git a/gcc/testsuite/g++.dg/template/friend58.C b/gcc/testsuite/g++.dg/template/friend58.C new file mode 100644 index 00000000000..cadfb3e1f43 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend58.C @@ -0,0 +1,19 @@ +// PR c++/42328 + +template +class freeList +{ +public: + void foo() {}; +}; + +class bar {}; + +class baz : protected freeList +{ + template + friend + void freeList::foo(); // { dg-error "friend" } +}; + +baz b; diff --git a/gcc/testsuite/g++.dg/template/friend59.C b/gcc/testsuite/g++.dg/template/friend59.C new file mode 100644 index 00000000000..e7c6d58ab1c --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend59.C @@ -0,0 +1,22 @@ +// PR c++/42328 + +template +class freeList +{ +public: + void foo() {}; +}; + +class bar {}; + +class baz; +template class freeList { void foo(); }; + +class baz : protected freeList +{ + template + friend + void freeList::foo(); +}; + +baz b; -- 2.30.2