This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Testcase for fixed c++/53
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jan 2003 00:27:08 +0000
- Subject: Testcase for fixed c++/53
Applied.
Neil.
* g++.dg/template/friend11.C: New test.
Index: template/friend11.C
===================================================================
RCS file: template/friend11.C
diff -N template/friend11.C
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ template/friend11.C 1 Jan 2003 00:25:41 -0000
@@ -0,0 +1,18 @@
+/* PR c++/53 */
+/* { dg-do compile } */
+
+template <class T>
+struct A {
+ template <class U> class B;
+
+ // Did not compile with gcc-2.95.2 (linux i686) :-(
+ template <class S> template <class U> friend class A<S>::B;
+};
+
+template <class S> template <class U> class A<S>::B {
+};
+
+int main(){
+ A<double>::B<double> ab;
+ return 0;
+}