PR c++/31411
* except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
the MUST_NOT_THROW_EXPR.
From-SVN: r128100
+2007-09-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/31411
+ * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
+ the MUST_NOT_THROW_EXPR.
+
2007-09-04 Richard Sandiford <richard@codesourcery.com>
* decl.c (cp_finish_decl): Call determine_visibility before
See also expand_default_init. */
init = ocp_convert (TREE_TYPE (decl), init,
CONV_IMPLICIT|CONV_FORCE_TEMP, 0);
+ /* Force cleanups now to avoid nesting problems with the
+ MUST_NOT_THROW_EXPR. */
+ init = build1 (CLEANUP_POINT_EXPR, TREE_TYPE (init), init);
init = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (init), init);
}
--- /dev/null
+// PR c++/31411
+
+struct allocator{
+ ~allocator() throw();
+};
+struct string
+{
+ string(const string& str, const allocator& al = allocator());
+};
+int main() {
+ try {}
+ catch (string smess) {}
+}