OSDN Git Service

PR c++/43024
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Feb 2010 04:01:10 +0000 (04:01 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Feb 2010 04:01:10 +0000 (04:01 +0000)
* g++.dg/opt/ice1.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156766 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/ice1.C [new file with mode: 0644]

index 891e33d..4ad1e67 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-14  Volker Reichelt  <reichelt@gcc.gnu.org>
+
+       PR c++/43024
+       * g++.dg/opt/ice1.C: New.
+
 2010-02-14  Jason Merrill  <jason@redhat.com>
 
        PR c++/41997
diff --git a/gcc/testsuite/g++.dg/opt/ice1.C b/gcc/testsuite/g++.dg/opt/ice1.C
new file mode 100644 (file)
index 0000000..7018971
--- /dev/null
@@ -0,0 +1,41 @@
+// PR c++/43024
+// { dg-options "-O2" }
+
+void foo();
+
+template<int> struct X
+{
+  enum { e };
+  typedef int Y;
+};
+
+template<int N = 0> struct A
+{
+  ~A() { foo(); }
+  A() { a<0>(0); }
+  template<int> void a(typename X<!X<N>::e>::Y);
+  struct B b();
+};
+
+struct B
+{
+  A<> b0, b1, b2, b3;
+  B operator+ (const B&);
+};
+
+struct C
+{
+  A<> c0, c1, c2, c3, c4, c5, c6, c7, c8;
+};
+
+inline void bar(int i)
+{
+  A<> a0, a1;
+  if (i) a0.b() + a0.b() + a0.b() + a0.b();
+}
+
+void baz()
+{
+  C c;
+  bar(0);
+}