[svn r134] Merged the DMD 1.024 frontend.

Added std.base64.
This commit is contained in:
Tomas Lindquist Olsen
2007-12-28 23:52:40 +01:00
parent 5eb88f9e80
commit 4428e47a66
14 changed files with 381 additions and 49 deletions

View File

@@ -1270,7 +1270,7 @@ RealExp::RealExp(Loc loc, real_t value, Type *type)
char *RealExp::toChars()
{
static char buffer[sizeof(value) * 3 + 8 + 1 + 1];
char buffer[sizeof(value) * 3 + 8 + 1 + 1];
#ifdef IN_GCC
value.format(buffer, sizeof(buffer));
@@ -1280,7 +1280,7 @@ char *RealExp::toChars()
sprintf(buffer, type->isimaginary() ? "%Lgi" : "%Lg", value);
#endif
assert(strlen(buffer) < sizeof(buffer));
return buffer;
return mem.strdup(buffer);
}
integer_t RealExp::toInteger()
@@ -1484,7 +1484,7 @@ ComplexExp::ComplexExp(Loc loc, complex_t value, Type *type)
char *ComplexExp::toChars()
{
static char buffer[sizeof(value) * 3 + 8 + 1];
char buffer[sizeof(value) * 3 + 8 + 1];
#ifdef IN_GCC
char buf1[sizeof(value) * 3 + 8 + 1];
@@ -1496,7 +1496,7 @@ char *ComplexExp::toChars()
sprintf(buffer, "(%Lg+%Lgi)", creall(value), cimagl(value));
assert(strlen(buffer) < sizeof(buffer));
#endif
return buffer;
return mem.strdup(buffer);
}
integer_t ComplexExp::toInteger()
@@ -3140,7 +3140,13 @@ Lagain:
if (cd->isInterfaceDeclaration())
error("cannot create instance of interface %s", cd->toChars());
else if (cd->isAbstract())
error("cannot create instance of abstract class %s", cd->toChars());
{ error("cannot create instance of abstract class %s", cd->toChars());
for (int i = 0; i < cd->vtbl.dim; i++)
{ FuncDeclaration *fd = ((Dsymbol *)cd->vtbl.data[i])->isFuncDeclaration();
if (fd && fd->isAbstract())
error("function %s is abstract", fd->toChars());
}
}
checkDeprecated(sc, cd);
if (cd->isNested())
{ /* We need a 'this' pointer for the nested class.
@@ -5528,9 +5534,9 @@ Lagain:
TemplateDeclaration *td = dte->td;
assert(td);
if (!arguments)
// Should fix deduce() so it works on NULL argument
// Should fix deduceFunctionTemplate() so it works on NULL argument
arguments = new Expressions();
f = td->deduce(sc, loc, NULL, arguments);
f = td->deduceFunctionTemplate(sc, loc, NULL, arguments);
if (!f)
{ type = Type::terror;
return this;
@@ -5705,7 +5711,7 @@ Lagain:
else if (e1->op == TOKtemplate)
{
TemplateExp *te = (TemplateExp *)e1;
f = te->td->deduce(sc, loc, NULL, arguments);
f = te->td->deduceFunctionTemplate(sc, loc, NULL, arguments);
if (!f)
{ type = Type::terror;
return this;