[gcc(refs/vendors/ibm/heads/gcc-10-branch)] d: Adjust backport of PR96250 for front-end implementation.

Peter Bergner bergner@gcc.gnu.org
Thu Sep 3 16:36:43 GMT 2020


https://gcc.gnu.org/g:bf465206b7012a9049821c68236093969d7767da

commit bf465206b7012a9049821c68236093969d7767da
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Fri Aug 21 01:52:28 2020 +0200

    d: Adjust backport of PR96250 for front-end implementation.
    
    gcc/d/ChangeLog:
    
    2020-08-21  Iain Buclaw  <ibuclaw@gdcproject.org>
    
            PR d/96250
            * dmd/expressionsem.c (ExpressionSemanticVisitor::visit(TypeExp)):
            Fix cast from Expression to VarExp.

Diff:
---
 gcc/d/dmd/expressionsem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/d/dmd/expressionsem.c b/gcc/d/dmd/expressionsem.c
index 562c2a60426..559c656e654 100644
--- a/gcc/d/dmd/expressionsem.c
+++ b/gcc/d/dmd/expressionsem.c
@@ -815,7 +815,7 @@ public:
             // `(Type)` is actually `(var)` so if `(var)` is a member requiring `this`
             // then rewrite as `(this.var)` in case it would be followed by a DotVar
             // to fix https://issues.dlang.org/show_bug.cgi?id=9490
-            VarExp *ve = e->isVarExp();
+            VarExp *ve = (e->op == TOKvar) ? (VarExp *)e : NULL;
             if (ve && ve->var && exp->parens && !ve->var->isStatic() && !(sc->stc & STCstatic) &&
                 sc->func && sc->func->needThis() && ve->var->toParent2()->isAggregateDeclaration())
             {


More information about the Gcc-cvs mailing list