Andrew Pinski <pinskia@physics.uc.edu>
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 17 Jul 2003 22:53:46 +0000 (22:53 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 17 Jul 2003 22:53:46 +0000 (15:53 -0700)
        PR c++/10476
        * g++.dg/expr/crash-1.C: New test.

        PR c++/11027
        * g++.dg/template/init3.C: New test.

        PR c++/8222
        * g++.dg/template/non-dependent1.C: New test.

        PR c++/11070
        * g++.dg/template/non-dependent2.C: New test.

        PR c++/11071
        * g++.dg/template/non-dependent3.C: New test.

        PR c++/9907
        * g++.dg/template/sizeof5.C: New test.

From-SVN: r69529

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/crash-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/init3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/non-dependent1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/non-dependent2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/non-dependent3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/sizeof5.C [new file with mode: 0644]

index 9be0bd6..b0b3f44 100644 (file)
@@ -1,3 +1,23 @@
+2003-07-17  Andrew Pinski <pinskia@physics.uc.edu>
+
+       PR c++/10476
+       * g++.dg/expr/crash-1.C: New test.
+
+       PR c++/11027
+       * g++.dg/template/init3.C: New test.
+
+       PR c++/8222
+       * g++.dg/template/non-dependent1.C: New test.
+
+       PR c++/11070
+       * g++.dg/template/non-dependent2.C: New test.
+
+       PR c++/11071
+       * g++.dg/template/non-dependent3.C: New test.
+
+       PR c++/9907
+       * g++.dg/template/sizeof5.C: New test.
+
 2003-07-17  Geoffrey Keating  <geoffk@apple.com>
 
        PR 11498
diff --git a/gcc/testsuite/g++.dg/expr/crash-1.C b/gcc/testsuite/g++.dg/expr/crash-1.C
new file mode 100644 (file)
index 0000000..d8d689f
--- /dev/null
@@ -0,0 +1,15 @@
+// C++ PR/10476
+// Origin: larsbj@gullik.net and bangerth@dealii.org
+
+
+struct X {
+  X();
+  X(const X& __str);
+};
+X const bar();
+void foo()
+{
+  X y;
+  (true ? y : bar());
+}
+
diff --git a/gcc/testsuite/g++.dg/template/init3.C b/gcc/testsuite/g++.dg/template/init3.C
new file mode 100644 (file)
index 0000000..9799a20
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/11027
+
+template <class T>
+struct X {
+   typedef void (X::*pfun)();
+   static pfun p[];
+};
+
+template <class T>
+typename X<T>::pfun X<T>::p[] = {};
+
diff --git a/gcc/testsuite/g++.dg/template/non-dependent1.C b/gcc/testsuite/g++.dg/template/non-dependent1.C
new file mode 100644 (file)
index 0000000..3fe5c33
--- /dev/null
@@ -0,0 +1,21 @@
+//PR c++/8222
+// Origin: giovannibajo@libero.it and setzersn@gmx.de
+
+// { dg-do run }
+
+struct Foo
+{
+    template <class>
+    void func() {}
+};
+template <class>
+void Bar(Foo* p)
+{
+    p->func<int>();
+}
+int main()
+{
+    Foo c;
+    Bar<int>(&c);
+}
diff --git a/gcc/testsuite/g++.dg/template/non-dependent2.C b/gcc/testsuite/g++.dg/template/non-dependent2.C
new file mode 100644 (file)
index 0000000..3b073b4
--- /dev/null
@@ -0,0 +1,16 @@
+//PR c++/11070
+// Used to ICE
+// Origin: bangerth@dealii.org and rwgk@yahoo.com
+
+template <bool b> struct X {
+    template <typename T>
+    static int* execute(int* x) { return x; }
+};
+
+template <typename T> void foo() {
+  static bool const same = true;
+  X<same>::execute<int> (0);
+}
+
+template void foo<int> ();
+
diff --git a/gcc/testsuite/g++.dg/template/non-dependent3.C b/gcc/testsuite/g++.dg/template/non-dependent3.C
new file mode 100644 (file)
index 0000000..ce18bf2
--- /dev/null
@@ -0,0 +1,15 @@
+//PR c++/11071
+// Used to ICE
+// Origin: bangerth@dealii.org and rwgk@yahoo.com
+
+template <bool b> struct X {
+    template <typename T>
+    static int* execute(T* x) { return x; }
+};
+
+template <typename T> void foo() {
+  static bool const same = true;
+  X<same>::execute ((int*)0);
+}
+
+template void foo<int> ();
diff --git a/gcc/testsuite/g++.dg/template/sizeof5.C b/gcc/testsuite/g++.dg/template/sizeof5.C
new file mode 100644 (file)
index 0000000..4096fed
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/9907
+// Origin: nes@lrde.epita.fr
+// sizeof(foo()) was not considered constant.
+
+
+template <unsigned n> struct bar {};
+
+int foo();
+
+template <class T>
+void baz()
+{
+  bar<sizeof(foo())> b;
+}
+