aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r--gcc/d/expr.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 7edcbc4..179f9a5 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -2238,13 +2238,17 @@ public:
new_call = build_nop (type, build_address (var));
setup_exp = modify_expr (var, aggregate_initializer_decl (cd));
}
+ else if (global.params.ehnogc && e->thrownew)
+ {
+ /* Allocating a `@nogc' Exception with `_d_newThrowable' has already
+ been handled by the front-end. */
+ gcc_unreachable ();
+ }
else
{
/* Generate: _d_newclass() */
tree arg = build_address (get_classinfo_decl (cd));
- libcall_fn libcall = (global.params.ehnogc && e->thrownew)
- ? LIBCALL_NEWTHROW : LIBCALL_NEWCLASS;
- new_call = build_libcall (libcall, tb, 1, arg);
+ new_call = build_libcall (LIBCALL_NEWCLASS, tb, 1, arg);
}
/* Set the context pointer for nested classes. */