Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ struct ASTBase
this.comment = Lexer.combineComments(this.comment.toDString(), comment.toDString(), true);
}

override const(char)* toChars()
override const(char)* toChars() const
{
return ident ? ident.toChars() : "__anonymous";
}
Expand Down Expand Up @@ -2768,7 +2768,7 @@ struct ASTBase
this.ty = ty;
}

override const(char)* toChars()
override const(char)* toChars() const
{
return "type";
}
Expand Down Expand Up @@ -6295,7 +6295,7 @@ struct ASTBase
return DYNCAST.tuple;
}

override const(char)* toChars()
override const(char)* toChars() const
{
return objects.toChars();
}
Expand Down Expand Up @@ -6323,14 +6323,14 @@ struct ASTBase
this.isdeprecated = isdeprecated;
}

extern (C++) const(char)* toChars()
extern (C++) const(char)* toChars() const
{
OutBuffer buf;
if (packages && packages.dim)
{
for (size_t i = 0; i < packages.dim; i++)
{
Identifier pid = (*packages)[i];
const Identifier pid = (*packages)[i];
buf.writestring(pid.toString());
buf.writeByte('.');
}
Expand Down
6 changes: 3 additions & 3 deletions src/dmd/attrib.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LinkDeclaration : public AttribDeclaration
static LinkDeclaration *create(LINK p, Dsymbols *decl);
Dsymbol *syntaxCopy(Dsymbol *s);
Scope *newScope(Scope *sc);
const char *toChars();
const char *toChars() const;
void accept(Visitor *v) { v->visit(this); }
};

Expand All @@ -88,7 +88,7 @@ class CPPMangleDeclaration : public AttribDeclaration

Dsymbol *syntaxCopy(Dsymbol *s);
Scope *newScope(Scope *sc);
const char *toChars();
const char *toChars() const;
void accept(Visitor *v) { v->visit(this); }
};

Expand All @@ -99,7 +99,7 @@ class CPPNamespaceDeclaration : public AttribDeclaration

Dsymbol *syntaxCopy(Dsymbol *s);
Scope *newScope(Scope *sc);
const char *toChars();
const char *toChars() const;
void accept(Visitor *v) { v->visit(this); }
};

Expand Down
6 changes: 3 additions & 3 deletions src/dmd/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ extern (C++) final class DebugCondition : DVCondition
v.visit(this);
}

override const(char)* toChars()
override const(char)* toChars() const
{
return ident ? ident.toChars() : "debug".ptr;
}
Expand Down Expand Up @@ -821,7 +821,7 @@ extern (C++) final class VersionCondition : DVCondition
v.visit(this);
}

override const(char)* toChars()
override const(char)* toChars() const
{
return ident ? ident.toChars() : "version".ptr;
}
Expand Down Expand Up @@ -887,7 +887,7 @@ extern (C++) final class StaticIfCondition : Condition
v.visit(this);
}

override const(char)* toChars()
override const(char)* toChars() const
{
return exp ? exp.toChars() : "static if".ptr;
}
Expand Down
6 changes: 3 additions & 3 deletions src/dmd/ctfe.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class VoidInitExp : public Expression
public:
VarDeclaration *var;

const char *toChars();
const char *toChars() const;
void accept(Visitor *v) { v->visit(this); }
};

Expand All @@ -49,7 +49,7 @@ class ThrownExceptionExp : public Expression
{
public:
ClassReferenceExp *thrown; // the thing being tossed
const char *toChars();
const char *toChars() const;
void accept(Visitor *v) { v->visit(this); }
};

Expand All @@ -60,5 +60,5 @@ class ThrownExceptionExp : public Expression
class CTFEExp : public Expression
{
public:
const char *toChars();
const char *toChars() const;
};
4 changes: 2 additions & 2 deletions src/dmd/declaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ extern (C++) final class OverDeclaration : Declaration
return "overload alias"; // todo
}

override bool equals(RootObject o)
override bool equals(const RootObject o) const
{
if (this == o)
return true;
Expand Down Expand Up @@ -1718,7 +1718,7 @@ extern (C++) class TypeInfoDeclaration : VarDeclaration
assert(0); // should never be produced by syntax
}

override final const(char)* toChars()
override final const(char)* toChars() const
{
//printf("TypeInfoDeclaration::toChars() tinfo = %s\n", tinfo.toChars());
OutBuffer buf;
Expand Down
10 changes: 5 additions & 5 deletions src/dmd/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class OverDeclaration : public Declaration
bool hasOverloads;

const char *kind() const;
bool equals(RootObject *o);
bool equals(const RootObject *o) const;
bool overloadInsert(Dsymbol *s);

Dsymbol *toAlias();
Expand Down Expand Up @@ -286,7 +286,7 @@ class TypeInfoDeclaration : public VarDeclaration

static TypeInfoDeclaration *create(Type *tinfo);
Dsymbol *syntaxCopy(Dsymbol *);
const char *toChars();
const char *toChars() const;

TypeInfoDeclaration *isTypeInfoDeclaration() { return this; }
void accept(Visitor *v) { v->visit(this); }
Expand Down Expand Up @@ -561,7 +561,7 @@ class FuncDeclaration : public Declaration
Dsymbol *syntaxCopy(Dsymbol *);
bool functionSemantic();
bool functionSemantic3();
bool equals(RootObject *o);
bool equals(const RootObject *o) const;

int overrides(FuncDeclaration *fd);
int findVtblIndex(Dsymbols *vtbl, int dim, bool fix17349 = true);
Expand Down Expand Up @@ -658,7 +658,7 @@ class CtorDeclaration : public FuncDeclaration
bool isCpCtor;
Dsymbol *syntaxCopy(Dsymbol *);
const char *kind() const;
const char *toChars();
const char *toChars() const;
bool isVirtual() const;
bool addPreInvariant();
bool addPostInvariant();
Expand All @@ -685,7 +685,7 @@ class DtorDeclaration : public FuncDeclaration
public:
Dsymbol *syntaxCopy(Dsymbol *);
const char *kind() const;
const char *toChars();
const char *toChars() const;
bool isVirtual() const;
bool addPreInvariant();
bool addPostInvariant();
Expand Down
5 changes: 5 additions & 0 deletions src/dmd/doc.d
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ private class Section
size_t bodylen;
int nooutput;

override string toString() const
{
assert(0);
}

void write(Loc loc, DocComment* dc, Scope* sc, Dsymbols* a, OutBuffer* buf)
{
assert(a.dim);
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ extern (C++) class Dsymbol : ASTNode
return new Dsymbol(ident);
}

override const(char)* toChars()
override const(char)* toChars() const
{
return ident ? ident.toChars() : "__anonymous";
}
Expand All @@ -296,7 +296,7 @@ extern (C++) class Dsymbol : ASTNode
return getLoc().toChars();
}

override bool equals(RootObject o)
override bool equals(const RootObject o) const
{
if (this == o)
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/dsymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ class Dsymbol : public ASTNode
UnitTestDeclaration *ddocUnittest; // !=NULL means there's a ddoc unittest associated with this symbol (only use this with ddoc)

static Dsymbol *create(Identifier *);
const char *toChars();
const char *toChars() const;
virtual const char *toPrettyCharsHelper(); // helper to print fully qualified (template) arguments
Loc getLoc();
const char *locToChars();
bool equals(RootObject *o);
bool equals(const RootObject *o) const;
virtual bool isAnonymous();
void error(const Loc &loc, const char *format, ...);
void error(const char *format, ...);
Expand Down
18 changes: 11 additions & 7 deletions src/dmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ extern (C++) final class Tuple : RootObject
return DYNCAST.tuple;
}

override const(char)* toChars()
override const(char)* toChars() const
{
return objects.toChars();
}
Expand Down Expand Up @@ -657,7 +657,7 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
return (onemember && onemember.isAggregateDeclaration()) ? onemember.kind() : "template";
}

override const(char)* toChars()
override const(char)* toChars() const
{
if (literal)
return Dsymbol.toChars();
Expand All @@ -669,7 +669,7 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
buf.writeByte('(');
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
const TemplateParameter tp = (*parameters)[i];
if (i)
buf.writestring(", ");
.toCBuffer(tp, &buf, &hgs);
Expand All @@ -678,7 +678,7 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol

if (onemember)
{
FuncDeclaration fd = onemember.isFuncDeclaration();
const FuncDeclaration fd = onemember.isFuncDeclaration();
if (fd && fd.type)
{
TypeFunction tf = cast(TypeFunction)fd.type;
Expand Down Expand Up @@ -5267,7 +5267,11 @@ extern (C++) class TemplateParameter : ASTNode

abstract bool hasDefaultArg();

override const(char)* toChars() { return this.ident.toChars(); }
override const(char)* toChars() const
{
return this.ident.toChars();
}

override DYNCAST dyncast() const pure @nogc nothrow @safe
{
return DYNCAST.templateparameter;
Expand Down Expand Up @@ -5826,7 +5830,7 @@ extern (C++) class TemplateInstance : ScopeDsymbol
return true;
}

override const(char)* toChars()
override const(char)* toChars() const
{
OutBuffer buf;
toCBufferInstance(this, &buf);
Expand Down Expand Up @@ -7455,7 +7459,7 @@ extern (C++) final class TemplateMixin : TemplateInstance
members.foreachDsymbol( (s) { s.setFieldOffset(ad, poffset, isunion); } );
}

override const(char)* toChars()
override const(char)* toChars() const
{
OutBuffer buf;
toCBufferInstance(this, &buf);
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/dversion.d
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ extern (C++) final class VersionSymbol : Dsymbol
return ds;
}

override const(char)* toChars() nothrow
override const(char)* toChars() const nothrow
{
if (ident)
return ident.toChars();
Expand Down
Loading