* gimplify.c (gimplify_expr) <case TRY_CATCH_EXPR>: Don't create
GIMPLE_TRY if cleanup sequence is empty.
* g++.dg/parse/crash48.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140401
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-09-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37530
+ * gimplify.c (gimplify_expr) <case TRY_CATCH_EXPR>: Don't create
+ GIMPLE_TRY if cleanup sequence is empty.
+
2008-09-16 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/37263
eval = cleanup = NULL;
gimplify_and_add (TREE_OPERAND (*expr_p, 0), &eval);
gimplify_and_add (TREE_OPERAND (*expr_p, 1), &cleanup);
+ /* Don't create bogus GIMPLE_TRY with empty cleanup. */
+ if (gimple_seq_empty_p (cleanup))
+ {
+ gimple_seq_add_seq (pre_p, eval);
+ ret = GS_ALL_DONE;
+ break;
+ }
try_ = gimple_build_try (eval, cleanup,
TREE_CODE (*expr_p) == TRY_FINALLY_EXPR
? GIMPLE_TRY_FINALLY
2008-09-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/37530
+ * g++.dg/parse/crash48.C: New test.
+
PR c++/37531
* g++.dg/parse/crash47.C: New test.
--- /dev/null
+// PR c++/37530
+// { dg-do compile }
+
+void
+foo (bool b)
+{
+ if (b)
+ try { throw 0; } catch (X) { } // { dg-error "expected type-specifier before" }
+}