diff options
Diffstat (limited to 'gcc/d/dmd/func.c')
-rw-r--r-- | gcc/d/dmd/func.c | 12 |
1 files changed, 12 insertions, 0 deletions
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; |