]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/15745 (exception specification incorrectly changes the type of the exceptio...
authorJason Merrill <jason@redhat.com>
Tue, 11 Sep 2007 15:20:47 +0000 (11:20 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 11 Sep 2007 15:20:47 +0000 (11:20 -0400)
        PR c++/15745
        * except.c (prepare_eh_type): Use type_decays_to.

        * except.c (initialize_handler_parm): Use
        fold_build_cleanup_point_expr.

        PR c++/31411
        * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
        the MUST_NOT_THROW_EXPR.

From-SVN: r128382

gcc/cp/ChangeLog
gcc/cp/except.c

index 4800e52f7f421882b635f15f368f9bf59a6c7f4c..897e9e3e705b1a2bb928671d6519bd8c6aae5d32 100644 (file)
@@ -1,3 +1,15 @@
+2007-09-11  Jason Merrill  <jason@redhat.com>
+
+       PR c++/15745
+       * except.c (prepare_eh_type): Use type_decays_to.
+
+       * except.c (initialize_handler_parm): Use
+       fold_build_cleanup_point_expr.
+
+       PR c++/31411
+       * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
+       the MUST_NOT_THROW_EXPR.
+
 2007-09-08  Jason Merrill  <jason@redhat.com>
 
        PR c++/33342
index eb9bad99a3a2532c22432a97a16fb981d2a50e82..a24098d7d6bf5bf9e94e6a7c7fc7a05bf8d9fbdf 100644 (file)
@@ -115,6 +115,9 @@ prepare_eh_type (tree type)
   /* Peel off cv qualifiers.  */
   type = TYPE_MAIN_VARIANT (type);
 
+  /* Functions and arrays decay to pointers.  */
+  type = type_decays_to (type);
+
   return type;
 }
 
@@ -388,6 +391,9 @@ initialize_handler_parm (tree decl, tree exp)
         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 = fold_build_cleanup_point_expr (TREE_TYPE (init), init);
       init = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (init), init);
     }