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
4 changes: 1 addition & 3 deletions src/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -7126,7 +7126,7 @@ public:
Identifier id; // can be null
TOK tok; // ':' or '=='
Type tspec; // can be null
TOK tok2; // 'struct', 'union', 'typedef', etc.
TOK tok2; // 'struct', 'union', etc.
TemplateParameters* parameters;

extern (D) this(Loc loc, Type targ, Identifier id, TOK tok, Type tspec, TOK tok2, TemplateParameters* parameters)
Expand Down Expand Up @@ -7181,8 +7181,6 @@ public:
{
switch (tok2)
{
case TOKtypedef:
goto Lno;
case TOKstruct:
if (targ.ty != Tstruct)
goto Lno;
Expand Down
2 changes: 1 addition & 1 deletion src/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ class IsExp : public Expression
Identifier *id; // can be NULL
TOK tok; // ':' or '=='
Type *tspec; // can be NULL
TOK tok2; // 'struct', 'union', 'typedef', etc.
TOK tok2; // 'struct', 'union', etc.
TemplateParameters *parameters;

IsExp(Loc loc, Type *targ, Identifier *id, TOK tok, Type *tspec,
Expand Down
34 changes: 9 additions & 25 deletions src/parse.d
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ public:
case TOKcomplex80:
case TOKvoid:
case TOKalias:
case TOKtypedef:
case TOKidentifier:
case TOKsuper:
case TOKtypeof:
Expand Down Expand Up @@ -3958,12 +3957,6 @@ public:

// alias StorageClasses type ident;
}
else if (token.value == TOKtypedef)
{
error("use alias instead of typedef");
tok = token.value;
nextToken();
}
parseStorageClasses(storage_class, link, structalign, udas);
if (token.value == TOKstruct || token.value == TOKunion || token.value == TOKclass || token.value == TOKinterface)
{
Expand Down Expand Up @@ -4049,7 +4042,7 @@ public:
checkCstyleTypeSyntax(loc, t, alt, ident);
else if (!isThis)
error("no identifier for declarator %s", t.toChars());
if (tok == TOKtypedef || tok == TOKalias)
if (tok == TOKalias)
{
Declaration v;
Initializer _init = null;
Expand All @@ -4066,21 +4059,15 @@ public:
nextToken();
_init = parseInitializer();
}
if (tok == TOKtypedef)
{
v = new AliasDeclaration(loc, ident, t); // dummy
}
else
if (_init)
{
if (_init)
{
if (isThis)
error("cannot use syntax 'alias this = %s', use 'alias %s this' instead", _init.toChars(), _init.toChars());
else
error("alias cannot have initializer");
}
v = new AliasDeclaration(loc, ident, t);
if (isThis)
error("cannot use syntax 'alias this = %s', use 'alias %s this' instead", _init.toChars(), _init.toChars());
else
error("alias cannot have initializer");
}
v = new AliasDeclaration(loc, ident, t);

v.storage_class = storage_class;
if (pAttrs)
{
Expand Down Expand Up @@ -4631,7 +4618,6 @@ public:
if (peekNext() == TOKlparen)
goto Lexp;
goto case;
case TOKtypedef:
case TOKalias:
case TOKconst:
case TOKauto:
Expand Down Expand Up @@ -6864,12 +6850,10 @@ public:
{
tok = token.value;
nextToken();
if (tok == TOKequal && (token.value == TOKtypedef || token.value == TOKstruct || token.value == TOKunion || token.value == TOKclass || token.value == TOKsuper || token.value == TOKenum || token.value == TOKinterface || token.value == TOKargTypes || token.value == TOKparameters || token.value == TOKconst && peek(&token).value == TOKrparen || token.value == TOKimmutable && peek(&token).value == TOKrparen || token.value == TOKshared && peek(&token).value == TOKrparen || token.value == TOKwild && peek(&token).value == TOKrparen || token.value == TOKfunction || token.value == TOKdelegate || token.value == TOKreturn))
if (tok == TOKequal && (token.value == TOKstruct || token.value == TOKunion || token.value == TOKclass || token.value == TOKsuper || token.value == TOKenum || token.value == TOKinterface || token.value == TOKargTypes || token.value == TOKparameters || token.value == TOKconst && peek(&token).value == TOKrparen || token.value == TOKimmutable && peek(&token).value == TOKrparen || token.value == TOKshared && peek(&token).value == TOKrparen || token.value == TOKwild && peek(&token).value == TOKrparen || token.value == TOKfunction || token.value == TOKdelegate || token.value == TOKreturn))
{
tok2 = token.value;
nextToken();
if (tok2 == TOKtypedef)
deprecation("typedef is removed");
}
else
{
Expand Down
3 changes: 0 additions & 3 deletions src/tokens.d
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ enum TOK : int
TOKunion,
TOKenum,
TOKimport,
TOKtypedef,
TOKalias,
TOKoverride,
TOKdelegate,
Expand Down Expand Up @@ -466,7 +465,6 @@ alias TOKinterface = TOK.TOKinterface;
alias TOKunion = TOK.TOKunion;
alias TOKenum = TOK.TOKenum;
alias TOKimport = TOK.TOKimport;
alias TOKtypedef = TOK.TOKtypedef;
alias TOKalias = TOK.TOKalias;
alias TOKoverride = TOK.TOKoverride;
alias TOKdelegate = TOK.TOKdelegate;
Expand Down Expand Up @@ -1006,7 +1004,6 @@ immutable Keyword[] keywords =
Keyword("static", TOKstatic),
Keyword("final", TOKfinal),
Keyword("const", TOKconst),
Keyword("typedef", TOKtypedef),
Keyword("alias", TOKalias),
Keyword("override", TOKoverride),
Keyword("abstract", TOKabstract),
Expand Down
2 changes: 1 addition & 1 deletion src/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ enum TOK
// 159
// Aggregates
TOKstruct, TOKclass, TOKinterface, TOKunion, TOKenum, TOKimport,
TOKtypedef, TOKalias, TOKoverride, TOKdelegate, TOKfunction,
TOKalias, TOKoverride, TOKdelegate, TOKfunction,
TOKmixin,

TOKalign, TOKextern, TOKprivate, TOKprotected, TOKpublic, TOKexport,
Expand Down
20 changes: 0 additions & 20 deletions test/fail_compilation/fail108.d

This file was deleted.

24 changes: 0 additions & 24 deletions test/fail_compilation/fail243t.d

This file was deleted.

18 changes: 0 additions & 18 deletions test/fail_compilation/fail6572.d

This file was deleted.

13 changes: 0 additions & 13 deletions test/fail_compilation/fail8664.d

This file was deleted.