mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-17 19:07:05 +02:00
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.
This commit is contained in:
+2
-2
@@ -3993,8 +3993,8 @@ void VarExp::checkEscape()
|
||||
// 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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user