diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-07-26 18:13:54 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-07-26 23:43:13 +0200 |
commit | 81a0fa31ce96327618023b476ea121dbe2494b04 (patch) | |
tree | 7a92b40bb7124e7e2449fef9983e22db836a0f65 /gcc/d/expr.cc | |
parent | 2009850b2b7042a678c385cd72e6ceb40caac8cd (diff) |
d: Merge upstream dmd 76e3b41375, druntime 1462ebd1, phobos 5fef0d28f.
Updates D language version to v2.100.1.
D front-end changes:
- Fix delegate literal with inferred return value that requires
following alias-this to not use class cast.
- Fix internal error on variadic template type instantiated with two
arrays of classes.
- `scope(failure)' blocks that contain `return' statements are now
deprecated.
- Fix regression where wrong cast was inserted for ternary operator
and non-int enums.
- Fix internal error in code generation trying to reference
_d_arraysetctor.
- Fix memory corruption when array literal is passed to map in
lambda, then returned from nested function.
- Generate invariant id on the basis of location rather than a
global counter.
- Make `noreturn' conversions work.
- Fix segfault when `.stringof' of template alias overloaded with
function accessed by trait.
- Empty array literal passed to scope param not 'falsey' anymore.
Phobos changes:
- Avoid copying ranges in std.algorithm.comparison.equal.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 76e3b41375.
* dmd/VERSION: Bump version to v2.100.1.
* decl.cc (DeclVisitor::visit (VarDeclaration *)): Evaluate RHS
of noreturn declaration expressions first.
* expr.cc (ExprVisitor::visit (AssignExp *)): Don't generate
assignment for noreturn types.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime 1462ebd1.
* src/MERGE: Merge upstream phobos 5fef0d28f.
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r-- | gcc/d/expr.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index 73dab463926..6fba382f0ed 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -916,6 +916,17 @@ public: gcc_unreachable (); } + /* Look for exp = noreturn; */ + if (e->e2->type->isTypeNoreturn ()) + { + /* If the RHS is a `noreturn' expression, there is no point generating + any code for the assignment, just evaluate side effects. */ + tree t1 = build_expr (e->e1); + tree t2 = build_expr (e->e2); + this->result_ = compound_expr (t1, t2); + return; + } + /* Look for array[] = n; */ if (e->e1->op == EXP::slice) { |