2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17907
* semantics.c (add_decl_expr): If the decl has a size which
has side effects then the decl expression needs a cleanup point.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17907
* g++.dg/eh/cleanup5.C: New test.
From-SVN: r88867
+2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/17907
+ * semantics.c (add_decl_expr): If the decl has a size which
+ has side effects then the decl expression needs a cleanup point.
+
2004-10-10 Mark Mitchell <mark@codesourcery.com>
PR c++/17393
add_decl_expr (tree decl)
{
tree r = build_stmt (DECL_EXPR, decl);
- if (DECL_INITIAL (decl))
+ if (DECL_INITIAL (decl)
+ || (DECL_SIZE (decl) && TREE_SIDE_EFFECTS (DECL_SIZE (decl))))
r = maybe_cleanup_point_expr (r);
add_stmt (r);
}
+2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/17907
+ * g++.dg/eh/cleanup5.C: New test.
+
2004-10-10 Mark Mitchell <mark@codesourcery.com>
PR c++/17393
--- /dev/null
+// PR 17907
+// { dg-do compile }
+// We lost a CLEANUP_POINT_EXPR, leading to a crash destroying temp of A.
+
+
+struct String {
+ ~String();
+ int size() const;
+};
+struct CodingSystem {
+ String convertOut() const;
+};
+void inputOpened(CodingSystem *outputCodingSystem)
+{
+ char filePath[outputCodingSystem->convertOut().size()];
+}