sizeof3.C: a similar testcase not involving base classes
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 31 Oct 1998 02:06:21 +0000 (02:06 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sat, 31 Oct 1998 02:06:21 +0000 (02:06 +0000)
* g++.old-deja/g++.pt/sizeof3.C: a similar testcase not involving
base classes

From-SVN: r23469

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.pt/sizeof3.C [new file with mode: 0644]

index 5ea28f511c26d3d31f52c9c2122a1b991504f727..830501c340ac6143fa53e64c1bc64b31e6d16667 100644 (file)
@@ -1,5 +1,8 @@
 1998-10-31  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * g++.old-deja/g++.pt/sizeof3.C: a similar testcase not involving
+       base classes
+
        * g++.old-deja/g++.pt/sizeof2.C: incorrect specialization of base
        template is selected
 
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/sizeof3.C b/gcc/testsuite/g++.old-deja/g++.pt/sizeof3.C
new file mode 100644 (file)
index 0000000..055ca0d
--- /dev/null
@@ -0,0 +1,27 @@
+// Adapted from testcase by Oskar Enoksson <osken393@student.liu.se>
+
+// execution test - XFAIL *-*-*
+
+extern "C" void abort();
+
+template<class T0>
+class A {
+public:
+  typedef T0 T;
+};
+
+template<int K>
+class B {
+  typedef A<char[K]> BC;
+};
+
+template<int N, int M>
+class C { 
+public:
+  typedef A<char[M]> AC;
+};
+
+int main() {
+  if (sizeof(C<3,7>::AC::T) != 7) // gets bogus error - XFAIL *-*-*
+    abort();
+}