diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-07-25 19:54:08 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-07-28 13:13:04 +0200 |
commit | 3e2136117487fa839f7601c3e22a2856978fb9d0 (patch) | |
tree | 0a96be35515f3aed36ecda3946949504be845423 /gcc/d/dmd/expression.c | |
parent | ea22954e7c580d1e54da4ac58301f65d5cf5f76a (diff) | |
download | gcc-3e2136117487fa839f7601c3e22a2856978fb9d0.zip gcc-3e2136117487fa839f7601c3e22a2856978fb9d0.tar.gz gcc-3e2136117487fa839f7601c3e22a2856978fb9d0.tar.bz2 |
d: Change in DotTemplateExp type semantics leading to regression (PR101619)
By giving dot templates a type, meant that properry resolving silently
started passing for code that should never have passed. The simple fix
is to provide implementations for checkType and checkValue that give an
error about dot templates having neither a value nor type.
Reviewed-on: https://github.com/dlang/dmd/pull/12920
PR d/101619
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 1d8386a63.
Diffstat (limited to 'gcc/d/dmd/expression.c')
-rw-r--r-- | gcc/d/dmd/expression.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/d/dmd/expression.c b/gcc/d/dmd/expression.c index 153819a..7166f97 100644 --- a/gcc/d/dmd/expression.c +++ b/gcc/d/dmd/expression.c @@ -4200,6 +4200,18 @@ DotTemplateExp::DotTemplateExp(Loc loc, Expression *e, TemplateDeclaration *td) this->td = td; } +bool DotTemplateExp::checkType() +{ + error("%s %s has no type", td->kind(), toChars()); + return true; +} + +bool DotTemplateExp::checkValue() +{ + error("%s %s has no value", td->kind(), toChars()); + return true; +} + /************************************************************/ DotVarExp::DotVarExp(Loc loc, Expression *e, Declaration *var, bool hasOverloads) |