summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/friend28.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/friend28.C')
-rw-r--r--gcc/testsuite/g++.dg/template/friend28.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/friend28.C b/gcc/testsuite/g++.dg/template/friend28.C
new file mode 100644
index 000000000..a7d160d5f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend28.C
@@ -0,0 +1,23 @@
+// PR c++/15629
+// { dg-do link }
+
+template<int a, int b> class T;
+
+template<int a, int b> void func(T<a, b> * t);
+template<int a> void func(T<a, 3> * t) {}
+template void func<2>(T<2, 3>*);
+
+template<int a, int b> struct T {
+ friend void func<a, b>(T<a, b> * t);
+ friend void func<a> (T<a, 3> * t);
+
+ void foo();
+};
+
+template<int a, int b> void T<a, b>::foo() {
+ func((T<2,3>*)0);
+}
+
+int main() {
+ T<2,3>().foo();
+}