summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/crash43.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/crash43.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash43.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash43.C b/gcc/testsuite/g++.old-deja/g++.pt/crash43.C
new file mode 100644
index 000000000..5172bbca2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash43.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <int T>
+struct S {
+ struct X {};
+ struct Y {};
+
+ template <int U>
+ friend struct S<U>::X;
+
+ template <int U>
+ friend typename S<U>::Y; // { dg-error "" } typename as friend
+};
+
+struct T {
+ template <int T>
+ friend struct S<T>::X;
+};
+
+struct U {
+ template <int T>
+ friend typename S<T>::X; // { dg-error "" } typename as friend
+};