diff 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
line wrap: on
line diff
--- a/dmd/expression.c	Fri Jul 10 21:30:02 2009 +0200
+++ b/dmd/expression.c	Sun Jul 12 16:15:21 2009 +0200
@@ -3993,8 +3993,8 @@
 	// if reference type
 	if (tb->ty == Tarray || tb->ty == Tsarray || tb->ty == Tclass)
 	{
-	    if ((v->isAuto() || v->isScope()) && !v->noauto)
-		error("escaping reference to auto local %s", v->toChars());
+	    if (v->isScope() && !v->noscope)
+		error("escaping reference to scope local %s", v->toChars());
 	    else if (v->storage_class & STCvariadic)
 		error("escaping reference to variadic parameter %s", v->toChars());
 	}