mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-26 21:49:03 +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:
@@ -333,7 +333,7 @@ void DeclarationStatement::scopeCode(Statement **sentry, Statement **sexception,
|
||||
if (v)
|
||||
{ Expression *e;
|
||||
|
||||
e = v->callAutoDtor();
|
||||
e = v->callScopeDtor();
|
||||
if (e)
|
||||
{
|
||||
//printf("dtor is: "); e->print();
|
||||
@@ -1590,7 +1590,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
{ VarDeclaration *v;
|
||||
|
||||
v = new VarDeclaration(loc, tret, Id::result, NULL);
|
||||
v->noauto = 1;
|
||||
v->noscope = 1;
|
||||
v->semantic(sc);
|
||||
if (!sc->insert(v))
|
||||
assert(0);
|
||||
@@ -1961,7 +1961,7 @@ Statement *IfStatement::semantic(Scope *sc)
|
||||
|
||||
Type *t = arg->type ? arg->type : condition->type;
|
||||
match = new VarDeclaration(loc, t, arg->ident, NULL);
|
||||
match->noauto = 1;
|
||||
match->noscope = 1;
|
||||
match->semantic(scd);
|
||||
if (!scd->insert(match))
|
||||
assert(0);
|
||||
@@ -2931,7 +2931,7 @@ Statement *ReturnStatement::semantic(Scope *sc)
|
||||
if (!fd->vresult)
|
||||
{ // Declare vresult
|
||||
VarDeclaration *v = new VarDeclaration(loc, tret, Id::result, NULL);
|
||||
v->noauto = 1;
|
||||
v->noscope = 1;
|
||||
v->semantic(scx);
|
||||
if (!scx->insert(v))
|
||||
assert(0);
|
||||
|
||||
Reference in New Issue
Block a user