Mercurial > projects > ldc
diff dmd/mtype.c @ 1530:05c235309d6f
Make the auto storage class never have the same meaning as scope.
This changes the meaning of
auto class MyClass {} and
auto MyClass ident;
Both have been made an error to prevent accidents.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 12 Jul 2009 16:15:21 +0200 |
parents | df11cdec45a2 |
children | def7a1d494fd |
line wrap: on
line diff
--- a/dmd/mtype.c Fri Jul 10 21:30:02 2009 +0200 +++ b/dmd/mtype.c Sun Jul 12 16:15:21 2009 +0200 @@ -548,7 +548,7 @@ return NULL; } -int Type::isauto() +int Type::isscope() { return FALSE; } @@ -1996,8 +1996,8 @@ tbn = next = tint32; break; } - if (tbn->isauto()) - error(loc, "cannot have array of auto %s", tbn->toChars()); + if (tbn->isscope()) + error(loc, "cannot have array of scope %s", tbn->toChars()); return merge(); } @@ -2159,8 +2159,8 @@ tn = next = tint32; break; } - if (tn->isauto()) - error(loc, "cannot have array of auto %s", tn->toChars()); + if (tn->isscope()) + error(loc, "cannot have array of scope %s", tn->toChars()); if (next != tn) //deco = NULL; // redo return tn->arrayOf(); @@ -2358,8 +2358,8 @@ error(loc, "can't have associative array of %s", next->toChars()); break; } - if (next->isauto()) - error(loc, "cannot have array of auto %s", next->toChars()); + if (next->isscope()) + error(loc, "cannot have array of scope %s", next->toChars()); return merge(); } @@ -2996,8 +2996,8 @@ { error(loc, "functions cannot return a tuple"); tf->next = Type::terror; } - if (tf->next->isauto() && !(sc->flags & SCOPEctor)) - error(loc, "functions cannot return auto %s", tf->next->toChars()); + if (tf->next->isscope() && !(sc->flags & SCOPEctor)) + error(loc, "functions cannot return scope %s", tf->next->toChars()); if (tf->parameters) { size_t dim = Argument::dim(tf->parameters); @@ -5068,9 +5068,9 @@ return sym; } -int TypeClass::isauto() -{ - return sym->isauto; +int TypeClass::isscope() +{ + return sym->isscope; } int TypeClass::isBaseOf(Type *t, int *poffset)