PR tree-optimization/42890
* g++.dg/torture/pr42890.C: New test.
From-SVN: r156604
+2010-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/42890
+ * g++.dg/torture/pr42890.C: New test.
+
2010-02-08 Richard Guenther <rguenther@suse.de>
PR middle-end/42995
--- /dev/null
+// PR tree-optimization/42890
+// { dg-do compile }
+
+extern "C" int puts (const char *) throw ();
+
+struct S
+{
+ const char *a;
+ const char **b;
+ S (const char *s) { a = s; b = &a; }
+ ~S () { puts (a); }
+};
+
+void
+foo (int (*fn) (const char *))
+{
+ S a ("foo");
+ fn ("bar");
+}
+
+int
+main ()
+{
+ foo (puts);
+}