* g++.dg/torture/pr42890.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156604
138bc75d-0d04-0410-961f-
82ee72b054a4
+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);
+}