mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23:14 +01:00
Merged DMD commit f8352960ff2b0533740e29e34bc86d632c8967bf:
4245 Declaring conflicting symbols in single function scope allowed Merged D2->D1
This commit is contained in:
@@ -4430,9 +4430,14 @@ Expression *DeclarationExp::semantic(Scope *sc)
|
||||
error("declaration %s is already defined", s->toPrettyChars());
|
||||
else if (sc->func)
|
||||
{ VarDeclaration *v = s->isVarDeclaration();
|
||||
if ((s->isFuncDeclaration() /*|| v && v->storage_class & STCstatic*/) &&
|
||||
if ( (s->isFuncDeclaration() || s->isTypedefDeclaration() ||
|
||||
s->isAggregateDeclaration() || s->isEnumDeclaration() ||
|
||||
s->isInterfaceDeclaration()) &&
|
||||
!sc->func->localsymtab->insert(s))
|
||||
error("declaration %s is already defined in another scope in %s", s->toPrettyChars(), sc->func->toChars());
|
||||
{
|
||||
error("declaration %s is already defined in another scope in %s",
|
||||
s->toPrettyChars(), sc->func->toChars());
|
||||
}
|
||||
else if (!global.params.useDeprecated)
|
||||
{ // Disallow shadowing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user