diff options
Diffstat (limited to 'gcc/d/dmd')
-rw-r--r-- | gcc/d/dmd/MERGE | 2 | ||||
-rw-r--r-- | gcc/d/dmd/expressionsem.c | 18 | ||||
-rw-r--r-- | gcc/d/dmd/func.c | 12 | ||||
-rw-r--r-- | gcc/d/dmd/mtype.c | 7 |
4 files changed, 32 insertions, 7 deletions
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index 7258fad..7b46e8f 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -ab03e2918508d62efcc5ee66c9a912a331b33aa0 +3be8a80bb0c4e01c436be970ac3555ceabb3caf8 The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/gcc/d/dmd/expressionsem.c b/gcc/d/dmd/expressionsem.c index ebdfae5..5177f9f 100644 --- a/gcc/d/dmd/expressionsem.c +++ b/gcc/d/dmd/expressionsem.c @@ -1806,11 +1806,19 @@ public: Expression *e; if (ea && ta->toBasetype()->ty == Tclass) { - /* Get the dynamic type, which is .classinfo - */ - ea = semantic(ea, sc); - e = new TypeidExp(ea->loc, ea); - e->type = Type::typeinfoclass->type; + if (!Type::typeinfoclass) + { + error(exp->loc, "`object.TypeInfo_Class` could not be found, but is implicitly used"); + e = new ErrorExp(); + } + else + { + /* Get the dynamic type, which is .classinfo + */ + ea = semantic(ea, sc); + e = new TypeidExp(ea->loc, ea); + e->type = Type::typeinfoclass->type; + } } else if (ta->ty == Terror) { diff --git a/gcc/d/dmd/func.c b/gcc/d/dmd/func.c index 568decc..04c70cf 100644 --- a/gcc/d/dmd/func.c +++ b/gcc/d/dmd/func.c @@ -1520,6 +1520,18 @@ void FuncDeclaration::semantic3(Scope *sc) { if (f->linkage == LINKd) { + // Variadic arguments depend on Typeinfo being defined + if (!global.params.useTypeInfo || !Type::dtypeinfo || !Type::typeinfotypelist) + { + if (!global.params.useTypeInfo) + error("D-style variadic functions cannot be used with -betterC"); + else if (!Type::typeinfotypelist) + error("`object.TypeInfo_Tuple` could not be found, but is implicitly used in D-style variadic functions"); + else + error("`object.TypeInfo` could not be found, but is implicitly used in D-style variadic functions"); + fatal(); + } + // Declare _arguments[] v_arguments = new VarDeclaration(Loc(), Type::typeinfotypelist->type, Id::_arguments_typeinfo, NULL); v_arguments->storage_class |= STCtemp | STCparameter; diff --git a/gcc/d/dmd/mtype.c b/gcc/d/dmd/mtype.c index 2562f36..1757b49 100644 --- a/gcc/d/dmd/mtype.c +++ b/gcc/d/dmd/mtype.c @@ -8350,7 +8350,12 @@ L1: if (ident == Id::classinfo) { - assert(Type::typeinfoclass); + if (!Type::typeinfoclass) + { + error(e->loc, "`object.TypeInfo_Class` could not be found, but is implicitly used"); + return new ErrorExp(); + } + Type *t = Type::typeinfoclass->type; if (e->op == TOKtype || e->op == TOKdottype) { |