comparison dmd/expression.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
comparison
equal deleted inserted replaced
1529:ad7f2f1862d6 1530:05c235309d6f
3991 if (v) 3991 if (v)
3992 { Type *tb = v->type->toBasetype(); 3992 { Type *tb = v->type->toBasetype();
3993 // if reference type 3993 // if reference type
3994 if (tb->ty == Tarray || tb->ty == Tsarray || tb->ty == Tclass) 3994 if (tb->ty == Tarray || tb->ty == Tsarray || tb->ty == Tclass)
3995 { 3995 {
3996 if ((v->isAuto() || v->isScope()) && !v->noauto) 3996 if (v->isScope() && !v->noscope)
3997 error("escaping reference to auto local %s", v->toChars()); 3997 error("escaping reference to scope local %s", v->toChars());
3998 else if (v->storage_class & STCvariadic) 3998 else if (v->storage_class & STCvariadic)
3999 error("escaping reference to variadic parameter %s", v->toChars()); 3999 error("escaping reference to variadic parameter %s", v->toChars());
4000 } 4000 }
4001 } 4001 }
4002 } 4002 }