diff --git a/src/attrib.c b/src/attrib.c
index 7161986..67673cd 100644
--- a/src/attrib.c
+++ b/src/attrib.c
@@ -421,7 +421,7 @@ void StorageClassDeclaration::stcToCBuffer(OutBuffer *buf, StorageClass stc)
     struct SCstring
     {
         StorageClass stc;
-        enum TOK tok;
+        TOK tok;
         Identifier *id;
     };
 
@@ -462,7 +462,7 @@ void StorageClassDeclaration::stcToCBuffer(OutBuffer *buf, StorageClass stc)
     {
         if (stc & table[i].stc)
         {
-            enum TOK tok = table[i].tok;
+            TOK tok = table[i].tok;
 #if DMDV2
             if (tok == TOKat)
             {
diff --git a/src/builtin.c b/src/builtin.c
index 30cd380..73244fb 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -120,6 +120,11 @@ Expression *eval_builtin(enum BUILTIN builtin, Expressions *arguments)
             if (arg0->op == TOKfloat64)
                 e = new RealExp(0, fabsl(arg0->toReal()), arg0->type);
             break;
+
+        case BUILTINnot:
+        case BUILTINunknown:
+            e = NULL;
+            break;
     }
     return e;
 }
diff --git a/src/cond.c b/src/cond.c
index be50214..d718184 100644
--- a/src/cond.c
+++ b/src/cond.c
@@ -273,7 +273,7 @@ void StaticIfCondition::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /**************************** IftypeCondition *******************************/
 
-IftypeCondition::IftypeCondition(Loc loc, Type *targ, Identifier *id, enum TOK tok, Type *tspec)
+IftypeCondition::IftypeCondition(Loc loc, Type *targ, Identifier *id, TOK tok, Type *tspec)
     : Condition(loc)
 {
     this->targ = targ;
diff --git a/src/cond.h b/src/cond.h
index 5d6fb94..173ff3a 100644
--- a/src/cond.h
+++ b/src/cond.h
@@ -20,7 +20,6 @@ struct ScopeDsymbol;
 #ifdef _DH
 #include "lexer.h" // dmdhg
 #endif
-enum TOK;
 #ifdef _DH
 struct HdrGenState;
 #endif
@@ -93,10 +92,10 @@ struct IftypeCondition : Condition
      */
     Type *targ;
     Identifier *id;     // can be NULL
-    enum TOK tok;       // ':' or '=='
+    TOK tok;            // ':' or '=='
     Type *tspec;        // can be NULL
 
-    IftypeCondition(Loc loc, Type *targ, Identifier *id, enum TOK tok, Type *tspec);
+    IftypeCondition(Loc loc, Type *targ, Identifier *id, TOK tok, Type *tspec);
     Condition *syntaxCopy();
     int include(Scope *sc, ScopeDsymbol *s);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
diff --git a/src/constfold.c b/src/constfold.c
index ac1ef01..54f0d45 100644
--- a/src/constfold.c
+++ b/src/constfold.c
@@ -656,7 +656,7 @@ Expression *Xor(Type *type, Expression *e1, Expression *e2)
 
 /* Also returns EXP_CANT_INTERPRET if cannot be computed.
  */
-Expression *Equal(enum TOK op, Type *type, Expression *e1, Expression *e2)
+Expression *Equal(TOK op, Type *type, Expression *e1, Expression *e2)
 {   Expression *e;
     Loc loc = e1->loc;
     int cmp;
@@ -848,7 +848,7 @@ Expression *Equal(enum TOK op, Type *type, Expression *e1, Expression *e2)
     return e;
 }
 
-Expression *Identity(enum TOK op, Type *type, Expression *e1, Expression *e2)
+Expression *Identity(TOK op, Type *type, Expression *e1, Expression *e2)
 {
     Loc loc = e1->loc;
     int cmp;
@@ -879,7 +879,7 @@ Expression *Identity(enum TOK op, Type *type, Expression *e1, Expression *e2)
 }
 
 
-Expression *Cmp(enum TOK op, Type *type, Expression *e1, Expression *e2)
+Expression *Cmp(TOK op, Type *type, Expression *e1, Expression *e2)
 {   Expression *e;
     Loc loc = e1->loc;
     dinteger_t n;
diff --git a/src/declaration.c b/src/declaration.c
index b21bf08..4790980 100644
--- a/src/declaration.c
+++ b/src/declaration.c
@@ -1012,7 +1012,7 @@ Lagain:
     else if (storage_class & STCmanifest)
         error("manifest constants must have initializers");
 
-    enum TOK op = TOKconstruct;
+    TOK op = TOKconstruct;
     if (!init && !sc->inunion && !isStatic() && fd &&
         (!(storage_class & (STCfield | STCin | STCforeach | STCparameter | STCresult))
          || (storage_class & STCout)) &&
diff --git a/src/declaration.h b/src/declaration.h
index 8f63093..1284373 100644
--- a/src/declaration.h
+++ b/src/declaration.h
@@ -35,7 +35,6 @@ struct IRState;
 
 enum PROT;
 enum LINK;
-enum TOK;
 enum MATCH;
 enum PURE;
 
@@ -663,9 +662,9 @@ struct FuncAliasDeclaration : FuncDeclaration
 
 struct FuncLiteralDeclaration : FuncDeclaration
 {
-    enum TOK tok;                       // TOKfunction or TOKdelegate
+    TOK tok;                            // TOKfunction or TOKdelegate
 
-    FuncLiteralDeclaration(Loc loc, Loc endloc, Type *type, enum TOK tok,
+    FuncLiteralDeclaration(Loc loc, Loc endloc, Type *type, TOK tok,
         ForeachStatement *fes);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
     Dsymbol *syntaxCopy(Dsymbol *);
diff --git a/src/expression.c b/src/expression.c
index dbdcf0b..2c13c96 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -882,7 +882,7 @@ void argExpTypesToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *h
 
 /******************************** Expression **************************/
 
-Expression::Expression(Loc loc, enum TOK op, int size)
+Expression::Expression(Loc loc, TOK op, int size)
     : loc(loc)
 {
     //printf("Expression::Expression(op = %d) this = %p\n", op, this);
@@ -4141,7 +4141,7 @@ void NewAnonClassExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 /********************** SymbolExp **************************************/
 
 #if DMDV2
-SymbolExp::SymbolExp(Loc loc, enum TOK op, int size, Declaration *var, int hasOverloads)
+SymbolExp::SymbolExp(Loc loc, TOK op, int size, Declaration *var, int hasOverloads)
     : Expression(loc, op, size)
 {
     assert(var);
@@ -4936,8 +4936,8 @@ void HaltExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /************************************************************/
 
-IsExp::IsExp(Loc loc, Type *targ, Identifier *id, enum TOK tok,
-        Type *tspec, enum TOK tok2, TemplateParameters *parameters)
+IsExp::IsExp(Loc loc, Type *targ, Identifier *id, TOK tok,
+        Type *tspec, TOK tok2, TemplateParameters *parameters)
         : Expression(loc, TOKis, sizeof(IsExp))
 {
     this->targ = targ;
@@ -5280,7 +5280,7 @@ void IsExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /************************************************************/
 
-UnaExp::UnaExp(Loc loc, enum TOK op, int size, Expression *e1)
+UnaExp::UnaExp(Loc loc, TOK op, int size, Expression *e1)
         : Expression(loc, op, size)
 {
     this->e1 = e1;
@@ -5326,7 +5326,7 @@ void UnaExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /************************************************************/
 
-BinExp::BinExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2)
+BinExp::BinExp(Loc loc, TOK op, int size, Expression *e1, Expression *e2)
         : Expression(loc, op, size)
 {
     this->e1 = e1;
@@ -8276,7 +8276,7 @@ Expression *ArrayLengthExp::semantic(Scope *sc)
     return this;
 }
 
-Expression *opAssignToOp(Loc loc, enum TOK op, Expression *e1, Expression *e2)
+Expression *opAssignToOp(Loc loc, TOK op, Expression *e1, Expression *e2)
 {   Expression *e;
 
     switch (op)
@@ -8737,7 +8737,7 @@ void IndexExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /************************* PostExp ***********************************/
 
-PostExp::PostExp(enum TOK op, Loc loc, Expression *e)
+PostExp::PostExp(TOK op, Loc loc, Expression *e)
         : BinExp(loc, op, sizeof(PostExp), e,
           new IntegerExp(loc, 1, Type::tint32))
 {
@@ -8819,7 +8819,7 @@ void PostExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /************************* PreExp ***********************************/
 
-PreExp::PreExp(enum TOK op, Loc loc, Expression *e)
+PreExp::PreExp(TOK op, Loc loc, Expression *e)
         : UnaExp(loc, op, sizeof(PreExp), e)
 {
 }
@@ -10781,7 +10781,7 @@ void RemoveExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /************************************************************/
 
-CmpExp::CmpExp(enum TOK op, Loc loc, Expression *e1, Expression *e2)
+CmpExp::CmpExp(TOK op, Loc loc, Expression *e1, Expression *e2)
         : BinExp(loc, op, sizeof(CmpExp), e1, e2)
 {
 }
@@ -10878,7 +10878,7 @@ int CmpExp::isBit()
 
 /************************************************************/
 
-EqualExp::EqualExp(enum TOK op, Loc loc, Expression *e1, Expression *e2)
+EqualExp::EqualExp(TOK op, Loc loc, Expression *e1, Expression *e2)
         : BinExp(loc, op, sizeof(EqualExp), e1, e2)
 {
     assert(op == TOKequal || op == TOKnotequal);
@@ -10997,7 +10997,7 @@ int EqualExp::isBit()
 
 /************************************************************/
 
-IdentityExp::IdentityExp(enum TOK op, Loc loc, Expression *e1, Expression *e2)
+IdentityExp::IdentityExp(TOK op, Loc loc, Expression *e1, Expression *e2)
         : BinExp(loc, op, sizeof(IdentityExp), e1, e2)
 {
 }
@@ -11219,7 +11219,7 @@ void CondExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /****************************************************************/
 
-DefaultInitExp::DefaultInitExp(Loc loc, enum TOK subop, int size)
+DefaultInitExp::DefaultInitExp(Loc loc, TOK subop, int size)
     : Expression(loc, TOKdefault, size)
 {
     this->subop = subop;
diff --git a/src/expression.h b/src/expression.h
index c7819f1..94bc8c6 100644
--- a/src/expression.h
+++ b/src/expression.h
@@ -45,8 +45,6 @@ struct InterState;
 struct Symbol;          // back end symbol
 struct OverloadSet;
 
-enum TOK;
-
 // Back end
 struct IRState;
 struct dt_t;
@@ -63,7 +61,7 @@ Expression *resolveProperties(Scope *sc, Expression *e);
 void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d);
 Expression *build_overload(Loc loc, Scope *sc, Expression *ethis, Expression *earg, Identifier *id, Objects *targsi = NULL);
 Dsymbol *search_function(ScopeDsymbol *ad, Identifier *funcid);
-void inferApplyArgTypes(enum TOK op, Parameters *arguments, Expression *aggr);
+void inferApplyArgTypes(TOK op, Parameters *arguments, Expression *aggr);
 void argExpTypesToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs);
 void argsToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs);
 void expandTuples(Expressions *exps);
@@ -79,12 +77,12 @@ struct IntRange
 struct Expression : Object
 {
     Loc loc;                    // file location
-    enum TOK op;                // handy to minimize use of dynamic_cast
+    TOK op;                     // handy to minimize use of dynamic_cast
     Type *type;                 // !=NULL means that semantic() has been run
     unsigned char size;         // # of bytes in Expression so we can copy() it
     unsigned char parens;       // if this is a parenthesized expression
 
-    Expression(Loc loc, enum TOK op, int size);
+    Expression(Loc loc, TOK op, int size);
     Expression *copy();
     virtual Expression *syntaxCopy();
     virtual Expression *semantic(Scope *sc);
@@ -568,7 +566,7 @@ struct SymbolExp : Expression
     Declaration *var;
     int hasOverloads;
 
-    SymbolExp(Loc loc, enum TOK op, int size, Declaration *var, int hasOverloads);
+    SymbolExp(Loc loc, TOK op, int size, Declaration *var, int hasOverloads);
 
     elem *toElem(IRState *irs);
 };
@@ -714,13 +712,13 @@ struct IsExp : Expression
      */
     Type *targ;
     Identifier *id;     // can be NULL
-    enum TOK tok;       // ':' or '=='
+    TOK tok;            // ':' or '=='
     Type *tspec;        // can be NULL
-    enum TOK tok2;      // 'struct', 'union', 'typedef', etc.
+    TOK tok2;    ;      // 'struct', 'union', 'typedef', etc.
     TemplateParameters *parameters;
 
-    IsExp(Loc loc, Type *targ, Identifier *id, enum TOK tok, Type *tspec,
-        enum TOK tok2, TemplateParameters *parameters);
+    IsExp(Loc loc, Type *targ, Identifier *id, TOK tok, Type *tspec,
+        TOK tok2, TemplateParameters *parameters);
     Expression *syntaxCopy();
     Expression *semantic(Scope *sc);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
@@ -732,7 +730,7 @@ struct UnaExp : Expression
 {
     Expression *e1;
 
-    UnaExp(Loc loc, enum TOK op, int size, Expression *e1);
+    UnaExp(Loc loc, TOK op, int size, Expression *e1);
     Expression *syntaxCopy();
     Expression *semantic(Scope *sc);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
@@ -755,7 +753,7 @@ struct BinExp : Expression
     Expression *e1;
     Expression *e2;
 
-    BinExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2);
+    BinExp(Loc loc, TOK op, int size, Expression *e1, Expression *e2);
     Expression *syntaxCopy();
     Expression *semantic(Scope *sc);
     Expression *semanticp(Scope *sc);
@@ -788,7 +786,7 @@ struct BinExp : Expression
 
 struct BinAssignExp : BinExp
 {
-    BinAssignExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2)
+    BinAssignExp(Loc loc, TOK op, int size, Expression *e1, Expression *e2)
         : BinExp(loc, op, size, e1, e2)
     {
     }
@@ -1179,7 +1177,7 @@ struct IndexExp : BinExp
  */
 struct PostExp : BinExp
 {
-    PostExp(enum TOK op, Loc loc, Expression *e);
+    PostExp(TOK op, Loc loc, Expression *e);
     Expression *semantic(Scope *sc);
     Expression *interpret(InterState *istate);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
@@ -1191,7 +1189,7 @@ struct PostExp : BinExp
  */
 struct PreExp : UnaExp
 {
-    PreExp(enum TOK op, Loc loc, Expression *e);
+    PreExp(TOK op, Loc loc, Expression *e);
     Expression *semantic(Scope *sc);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
 };
@@ -1495,7 +1493,7 @@ struct AndAndExp : BinExp
 
 struct CmpExp : BinExp
 {
-    CmpExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
+    CmpExp(TOK op, Loc loc, Expression *e1, Expression *e2);
     Expression *semantic(Scope *sc);
     Expression *optimize(int result);
     Expression *interpret(InterState *istate);
@@ -1533,7 +1531,7 @@ struct RemoveExp : BinExp
 
 struct EqualExp : BinExp
 {
-    EqualExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
+    EqualExp(TOK op, Loc loc, Expression *e1, Expression *e2);
     Expression *semantic(Scope *sc);
     Expression *optimize(int result);
     Expression *interpret(InterState *istate);
@@ -1551,7 +1549,7 @@ struct EqualExp : BinExp
 
 struct IdentityExp : BinExp
 {
-    IdentityExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
+    IdentityExp(TOK op, Loc loc, Expression *e1, Expression *e2);
     Expression *semantic(Scope *sc);
     int isBit();
     Expression *optimize(int result);
@@ -1595,9 +1593,9 @@ struct CondExp : BinExp
 
 struct DefaultInitExp : Expression
 {
-    enum TOK subop;             // which of the derived classes this is
+    TOK subop;                  // which of the derived classes this is
 
-    DefaultInitExp(Loc loc, enum TOK subop, int size);
+    DefaultInitExp(Loc loc, TOK subop, int size);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
 };
 
@@ -1650,9 +1648,9 @@ Expression *Xor(Type *type, Expression *e1, Expression *e2);
 Expression *Index(Type *type, Expression *e1, Expression *e2);
 Expression *Cat(Type *type, Expression *e1, Expression *e2);
 
-Expression *Equal(enum TOK op, Type *type, Expression *e1, Expression *e2);
-Expression *Cmp(enum TOK op, Type *type, Expression *e1, Expression *e2);
-Expression *Identity(enum TOK op, Type *type, Expression *e1, Expression *e2);
+Expression *Equal(TOK op, Type *type, Expression *e1, Expression *e2);
+Expression *Cmp(TOK op, Type *type, Expression *e1, Expression *e2);
+Expression *Identity(TOK op, Type *type, Expression *e1, Expression *e2);
 
 Expression *Slice(Type *type, Expression *e1, Expression *lwr, Expression *upr);
 
diff --git a/src/func.c b/src/func.c
index cfa0939..aeb4888 100644
--- a/src/func.c
+++ b/src/func.c
@@ -2841,7 +2841,7 @@ const char *FuncAliasDeclaration::kind()
 /****************************** FuncLiteralDeclaration ************************/
 
 FuncLiteralDeclaration::FuncLiteralDeclaration(Loc loc, Loc endloc, Type *type,
-        enum TOK tok, ForeachStatement *fes)
+        TOK tok, ForeachStatement *fes)
     : FuncDeclaration(loc, endloc, NULL, STCundefined, type)
 {
     const char *id;
diff --git a/src/iasm.c b/src/iasm.c
index eba2a89..2f6e222 100644
--- a/src/iasm.c
+++ b/src/iasm.c
@@ -186,7 +186,7 @@ struct ASM_STATE
 ASM_STATE asmstate;
 
 static Token *asmtok;
-static enum TOK tok_value;
+static TOK tok_value;
 //char debuga = 1;
 
 // From ptrntab.c
@@ -500,7 +500,7 @@ STATIC OPND *asm_shift_exp();
 STATIC OPND *asm_una_exp();
 STATIC OPND *asm_xor_exp();
 STATIC void *link_alloc(size_t, void *);
-STATIC void asm_chktok(enum TOK toknum, unsigned errnum);
+STATIC void asm_chktok(TOK toknum, unsigned errnum);
 STATIC code *asm_db_parse(OP *pop);
 STATIC code *asm_da_parse(OP *pop);
 
@@ -532,7 +532,7 @@ STATIC void opnd_free(OPND *o)
 /*******************************
  */
 
-STATIC void asm_chktok(enum TOK toknum,unsigned errnum)
+STATIC void asm_chktok(TOK toknum,unsigned errnum)
 {
     if (tok_value == toknum)
         asm_token();                    // scan past token
@@ -3126,7 +3126,7 @@ STATIC void asm_token_trans(Token *tok)
             {
                 ASMTK asmtk = (ASMTK) binary(id, apszAsmtk, ASMTKmax);
                 if ((int)asmtk >= 0)
-                    tok_value = (enum TOK) (asmtk + TOKMAX + 1);
+                    tok_value = (TOK) (asmtk + TOKMAX + 1);
             }
         }
     }
@@ -3622,7 +3622,7 @@ STATIC OPND *asm_equal_exp()
 STATIC OPND *asm_rel_exp()
 {
     OPND *o1,*o2;
-    enum TOK tok_save;
+    TOK tok_save;
 
     o1 = asm_shift_exp();
     while (1)
@@ -3673,7 +3673,7 @@ STATIC OPND *asm_shift_exp()
 {
     OPND *o1,*o2;
     int op;
-    enum TOK tk;
+    TOK tk;
 
     o1 = asm_add_exp();
     while (tok_value == TOKshl || tok_value == TOKshr || tok_value == TOKushr)
@@ -3976,7 +3976,7 @@ STATIC OPND *asm_una_exp()
                     ajt = ASM_JUMPTYPE_FAR;
 JUMP_REF:
                     asm_token();
-                    asm_chktok((enum TOK) ASMTKptr, EM_ptr_exp);
+                    asm_chktok((TOK) ASMTKptr, EM_ptr_exp);
 JUMP_REF2:
                     o1 = asm_cond_exp();
                     if (!o1)
@@ -4006,7 +4006,7 @@ JUMP_REF2:
 TYPE_REF:
                     bPtr = 1;
                     asm_token();
-                    asm_chktok((enum TOK) ASMTKptr, EM_ptr_exp);
+                    asm_chktok((TOK) ASMTKptr, EM_ptr_exp);
 CAST_REF:
                     o1 = asm_cond_exp();
                     if (!o1)
@@ -4033,7 +4033,7 @@ STATIC OPND *asm_primary_exp()
         Dsymbol *s;
         Dsymbol *scopesym;
 
-        enum TOK tkOld;
+        TOK tkOld;
         int global;
         REG *regp;
 
diff --git a/src/interpret.c b/src/interpret.c
index f1772ad..ce701c4 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -1707,7 +1707,7 @@ BIN_INTERPRET(Or)
 BIN_INTERPRET(Xor)
 
 
-typedef Expression *(*fp2_t)(enum TOK, Type *, Expression *, Expression *);
+typedef Expression *(*fp2_t)(TOK, Type *, Expression *, Expression *);
 
 Expression *BinExp::interpretCommon2(InterState *istate, fp2_t fp)
 {   Expression *e;
diff --git a/src/lexer.c b/src/lexer.c
index 6848373..b6c8df9 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -223,7 +223,7 @@ const char *Token::toChars()
     return p;
 }
 
-const char *Token::toChars(enum TOK value)
+const char *Token::toChars(TOK value)
 {   const char *p;
     static char buffer[3 + 3 * sizeof(value) + 1];
 
@@ -677,7 +677,7 @@ void Lexer::scan(Token *t)
                     sv->ptrvalue = id;
                 }
                 t->ident = id;
-                t->value = (enum TOK) id->value;
+                t->value = (TOK) id->value;
                 anyToken = 1;
                 if (*t->ptr == '_')     // if special identifier token
                 {
@@ -2888,7 +2888,7 @@ Identifier *Lexer::uniqueId(const char *s)
 
 struct Keyword
 {   const char *name;
-    enum TOK value;
+    TOK value;
 };
 
 static Keyword keywords[] =
@@ -3034,7 +3034,7 @@ int Token::isKeyword()
 void Lexer::initKeywords()
 {   StringValue *sv;
     unsigned u;
-    enum TOK v;
+    TOK v;
     unsigned nkeywords = sizeof(keywords) / sizeof(keywords[0]);
 
     if (global.params.Dversion == 1)
diff --git a/src/lexer.h b/src/lexer.h
index 6dc3022..e17ed24 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -38,7 +38,7 @@ struct Module;
         ?       &&      ||
  */
 
-enum TOK
+enum ENUMTOK
 {
         TOKreserved,
 
@@ -172,6 +172,7 @@ enum TOK
 
         TOKMAX
 };
+typedef unsigned short TOK;       // ENUMTOK
 
 #define TOKwild TOKinout
 
@@ -217,7 +218,7 @@ struct Token
 {
     Token *next;
     unsigned char *ptr;         // pointer to first character of this token within buffer
-    enum TOK value;
+    TOK value;
     unsigned char *blockComment; // doc comment string prior to this token
     unsigned char *lineComment;  // doc comment for previous token
     union
@@ -253,7 +254,7 @@ struct Token
     int isKeyword();
     void print();
     const char *toChars();
-    static const char *toChars(enum TOK);
+    static const char *toChars(TOK);
 };
 
 struct Lexer
diff --git a/src/mtype.c b/src/mtype.c
index 3d2bfa0..3a2a04e 100644
--- a/src/mtype.c
+++ b/src/mtype.c
@@ -4670,6 +4670,8 @@ void TypeFunction::toDecoBuffer(OutBuffer *buf, int flag)
             case TRUSTsafe:
                 buf->writestring("Nf");
                 break;
+            default:
+                break;
         }
     }
     // Write argument types
@@ -4722,6 +4724,9 @@ void TypeFunction::toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs
         case TRUSTsafe:
             buf->writestring("@safe ");
             break;
+
+        default:
+            break;
     }
 
     if (next && (!ident || ident->toHChars2() == ident->toChars()))
@@ -4814,6 +4819,9 @@ void TypeFunction::attributesToCBuffer(OutBuffer *buf, int mod)
         case TRUSTsafe:
             buf->writestring(" @safe");
             break;
+
+        default:
+            break;
     }
 }
 
diff --git a/src/opover.c b/src/opover.c
index 1bc86aa..0f8ff1a 100644
--- a/src/opover.c
+++ b/src/opover.c
@@ -179,7 +179,7 @@ AggregateDeclaration *isAggregate(Type *t)
 /*******************************************
  * Helper function to turn operator into template argument list
  */
-Objects *opToArg(Scope *sc, enum TOK op)
+Objects *opToArg(Scope *sc, TOK op)
 {
     /* Remove the = from op=
      */
@@ -1185,7 +1185,7 @@ Dsymbol *search_function(ScopeDsymbol *ad, Identifier *funcid)
  * them from the aggregate type.
  */
 
-void inferApplyArgTypes(enum TOK op, Parameters *arguments, Expression *aggr)
+void inferApplyArgTypes(TOK op, Parameters *arguments, Expression *aggr)
 {
     if (!arguments || !arguments->dim)
         return;
diff --git a/src/optimize.c b/src/optimize.c
index 9e222b8..e93c7e4 100644
--- a/src/optimize.c
+++ b/src/optimize.c
@@ -535,7 +535,7 @@ Expression *CastExp::optimize(int result)
     //printf("e1->type %s\n", e1->type->toChars());
     //printf("type = %p\n", type);
     assert(type);
-    enum TOK op1 = e1->op;
+    TOK op1 = e1->op;
 #define X 0
 
     Expression *e1old = e1;
diff --git a/src/parse.c b/src/parse.c
index 162fa85..e8d84a8 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1464,7 +1464,7 @@ EnumDeclaration *Parser::parseEnum()
 Dsymbol *Parser::parseAggregate()
 {   AggregateDeclaration *a = NULL;
     int anon = 0;
-    enum TOK tok;
+    TOK tok;
     Identifier *id;
     TemplateParameters *tpl = NULL;
     Expression *constraint = NULL;
@@ -1955,7 +1955,7 @@ Objects *Parser::parseTemplateArgumentList2()
 {
     //printf("Parser::parseTemplateArgumentList2()\n");
     Objects *tiargs = new Objects();
-    enum TOK endtok = TOKrparen;
+    TOK endtok = TOKrparen;
     nextToken();
 
     // Get TemplateArgumentList
@@ -2443,7 +2443,7 @@ Type *Parser::parseBasicType2(Type *t)
                 //      t function(parameter list) nothrow pure
                 Parameters *arguments;
                 int varargs;
-                enum TOK save = token.value;
+                TOK save = token.value;
 
                 nextToken();
                 arguments = parseParameters(&varargs);
@@ -2656,7 +2656,7 @@ Dsymbols *Parser::parseDeclarations(StorageClass storage_class, unsigned char *c
     Type *tfirst;
     Identifier *ident;
     Dsymbols *a;
-    enum TOK tok = TOKreserved;
+    TOK tok = TOKreserved;
     enum LINK link = linkage;
 
     //printf("parseDeclarations() %s\n", token.toChars());
@@ -3654,7 +3654,7 @@ Statement *Parser::parseStatement(int flags)
         case TOKforeach:
         case TOKforeach_reverse:
         {
-            enum TOK op = token.value;
+            TOK op = token.value;
 
             nextToken();
             check(TOKlparen);
@@ -4243,19 +4243,19 @@ Statement *Parser::parseStatement(int flags)
     return s;
 }
 
-void Parser::check(enum TOK value)
+void Parser::check(TOK value)
 {
     check(loc, value);
 }
 
-void Parser::check(Loc loc, enum TOK value)
+void Parser::check(Loc loc, TOK value)
 {
     if (token.value != value)
         error(loc, "found '%s' when expecting '%s'", token.toChars(), Token::toChars(value));
     nextToken();
 }
 
-void Parser::check(enum TOK value, const char *string)
+void Parser::check(TOK value, const char *string)
 {
     if (token.value != value)
         error("found '%s' when expecting '%s' following %s",
@@ -4263,7 +4263,7 @@ void Parser::check(enum TOK value, const char *string)
     nextToken();
 }
 
-void Parser::checkParens(enum TOK value, Expression *e)
+void Parser::checkParens(TOK value, Expression *e)
 {
     if (precedence[e->op] == PREC_rel && !e->parens)
         error(loc, "%s must be parenthesized when next to operator %s", e->toChars(), Token::toChars(value));
@@ -4279,7 +4279,7 @@ void Parser::checkParens(enum TOK value, Expression *e)
  *      if *pt is not NULL, it is set to the ending token, which would be endtok
  */
 
-int Parser::isDeclaration(Token *t, int needId, enum TOK endtok, Token **pt)
+int Parser::isDeclaration(Token *t, int needId, TOK endtok, Token **pt)
 {
     //printf("isDeclaration(needId = %d)\n", needId);
     int haveId = 0;
@@ -4446,7 +4446,7 @@ Lfalse:
     return FALSE;
 }
 
-int Parser::isDeclarator(Token **pt, int *haveId, enum TOK endtok)
+int Parser::isDeclarator(Token **pt, int *haveId, TOK endtok)
 {   // This code parallels parseDeclarator()
     Token *t = *pt;
     int parens;
@@ -4908,7 +4908,7 @@ Expression *Parser::parsePrimaryExp()
 {   Expression *e;
     Type *t;
     Identifier *id;
-    enum TOK save;
+    TOK save;
     Loc loc = this->loc;
 
     //printf("parsePrimaryExp(): loc = %d\n", loc.linnum);
@@ -5155,8 +5155,8 @@ Expression *Parser::parsePrimaryExp()
         {   Type *targ;
             Identifier *ident = NULL;
             Type *tspec = NULL;
-            enum TOK tok = TOKreserved;
-            enum TOK tok2 = TOKreserved;
+            TOK tok = TOKreserved;
+            TOK tok2 = TOKreserved;
             TemplateParameters *tpl = NULL;
             Loc loc = this->loc;
 
@@ -5796,7 +5796,7 @@ Expression *Parser::parseShiftExp()
 Expression *Parser::parseRelExp()
 {   Expression *e;
     Expression *e2;
-    enum TOK op;
+    TOK op;
     Loc loc = this->loc;
 
     e = parseShiftExp();
@@ -5858,7 +5858,7 @@ Expression *Parser::parseEqualExp()
 
     e = parseRelExp();
     while (1)
-    {   enum TOK value = token.value;
+    {   TOK value = token.value;
 
         switch (value)
         {
@@ -5912,7 +5912,7 @@ Expression *Parser::parseCmpExp()
     Loc loc = this->loc;
 
     e = parseShiftExp();
-    enum TOK op = token.value;
+    TOK op = token.value;
 
     switch (op)
     {
@@ -6142,7 +6142,7 @@ Expressions *Parser::parseArguments()
 {   // function call
     Expressions *arguments;
     Expression *arg;
-    enum TOK endtok;
+    TOK endtok;
 
     arguments = new Expressions();
     if (token.value == TOKlbracket)
diff --git a/src/parse.h b/src/parse.h
index bfcddd5..b85e85a 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -113,13 +113,13 @@ struct Parser : Lexer
     Statement *parseStatement(int flags);
     Initializer *parseInitializer();
     Expression *parseDefaultInitExp();
-    void check(Loc loc, enum TOK value);
-    void check(enum TOK value);
-    void check(enum TOK value, const char *string);
-    void checkParens(enum TOK value, Expression *e);
-    int isDeclaration(Token *t, int needId, enum TOK endtok, Token **pt);
+    void check(Loc loc, TOK value);
+    void check(TOK value);
+    void check(TOK value, const char *string);
+    void checkParens(TOK value, Expression *e);
+    int isDeclaration(Token *t, int needId, TOK endtok, Token **pt);
     int isBasicType(Token **pt);
-    int isDeclarator(Token **pt, int *haveId, enum TOK endtok);
+    int isDeclarator(Token **pt, int *haveId, TOK endtok);
     int isParameters(Token **pt);
     int isExpression(Token **pt);
     int isTemplateInstance(Token *t, Token **pt);
diff --git a/src/statement.c b/src/statement.c
index fe598ce..2ab3c20 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -1309,7 +1309,7 @@ void ForStatement::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 /******************************** ForeachStatement ***************************/
 
-ForeachStatement::ForeachStatement(Loc loc, enum TOK op, Parameters *arguments,
+ForeachStatement::ForeachStatement(Loc loc, TOK op, Parameters *arguments,
         Expression *aggr, Statement *body)
     : Statement(loc)
 {
@@ -2061,7 +2061,7 @@ void ForeachStatement::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
 
 #if DMDV2
 
-ForeachRangeStatement::ForeachRangeStatement(Loc loc, enum TOK op, Parameter *arg,
+ForeachRangeStatement::ForeachRangeStatement(Loc loc, TOK op, Parameter *arg,
         Expression *lwr, Expression *upr, Statement *body)
     : Statement(loc)
 {
diff --git a/src/statement.h b/src/statement.h
index 7123ac2..a601496 100644
--- a/src/statement.h
+++ b/src/statement.h
@@ -48,8 +48,6 @@ struct TryFinallyStatement;
 struct HdrGenState;
 struct InterState;
 
-enum TOK;
-
 // Back end
 struct IRState;
 struct Blockx;
@@ -325,7 +323,7 @@ struct ForStatement : Statement
 
 struct ForeachStatement : Statement
 {
-    enum TOK op;                // TOKforeach or TOKforeach_reverse
+    TOK op;                     // TOKforeach or TOKforeach_reverse
     Parameters *arguments;      // array of Parameter*'s
     Expression *aggr;
     Statement *body;
@@ -338,7 +336,7 @@ struct ForeachStatement : Statement
     Array *cases;        // put breaks, continues, gotos and returns here
     Array *gotos;        // forward referenced goto's go here
 
-    ForeachStatement(Loc loc, enum TOK op, Parameters *arguments, Expression *aggr, Statement *body);
+    ForeachStatement(Loc loc, TOK op, Parameters *arguments, Expression *aggr, Statement *body);
     Statement *syntaxCopy();
     Statement *semantic(Scope *sc);
     bool checkForArgTypes();
@@ -358,7 +356,7 @@ struct ForeachStatement : Statement
 #if DMDV2
 struct ForeachRangeStatement : Statement
 {
-    enum TOK op;                // TOKforeach or TOKforeach_reverse
+    TOK op;                     // TOKforeach or TOKforeach_reverse
     Parameter *arg;             // loop index variable
     Expression *lwr;
     Expression *upr;
@@ -366,7 +364,7 @@ struct ForeachRangeStatement : Statement
 
     VarDeclaration *key;
 
-    ForeachRangeStatement(Loc loc, enum TOK op, Parameter *arg,
+    ForeachRangeStatement(Loc loc, TOK op, Parameter *arg,
         Expression *lwr, Expression *upr, Statement *body);
     Statement *syntaxCopy();
     Statement *semantic(Scope *sc);
