aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60419.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60419.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60419.C80
1 files changed, 80 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60419.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60419.C
new file mode 100644
index 000000000..84461f3ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60419.C
@@ -0,0 +1,80 @@
+// PR middle-end/60419
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct C
+{
+};
+
+struct I : C
+{
+ I ();
+};
+
+struct J
+{
+ void foo ();
+ J ();
+ virtual void foo (int &, int);
+};
+
+template <class>
+struct D
+{
+ virtual void foo (I &) const;
+ void bar ()
+ {
+ I p;
+ foo (p);
+ }
+};
+
+struct K : J, public D<int>
+{
+};
+
+struct F
+{
+ K *operator->();
+};
+
+struct N : public K
+{
+ void foo (int &, int);
+ I n;
+ void foo (I &) const {}
+};
+
+struct L : J
+{
+ F l;
+};
+
+struct M : F
+{
+ L *operator->();
+};
+
+struct G
+{
+ G ();
+};
+
+M h;
+
+G::G ()
+try
+{
+ N f;
+ f.bar ();
+ throw;
+}
+catch (int)
+{
+}
+
+void
+baz ()
+{
+ h->l->bar ();
+}