Mercurial > projects > ddmd
diff dmd/Dsymbol.d @ 179:cd48cb899aee
Updated to dmd2.040
author | korDen |
---|---|
date | Sun, 17 Oct 2010 20:56:07 +0400 |
parents | e3afd1303184 |
children | b0d41ff5e0df |
line wrap: on
line diff
--- a/dmd/Dsymbol.d Sun Oct 17 07:42:00 2010 +0400 +++ b/dmd/Dsymbol.d Sun Oct 17 20:56:07 2010 +0400 @@ -12,6 +12,8 @@ import dmd.Id; import dmd.Identifier; import dmd.TemplateInstance; +import dmd.SharedStaticCtorDeclaration; +import dmd.SharedStaticDtorDeclaration; import dmd.HdrGenState; import dmd.AggregateDeclaration; import dmd.ClassDeclaration; @@ -250,21 +252,34 @@ for (Dsymbol sp = sc.parent; sp; sp = sp.parent) { if (sp.isDeprecated()) - return; + goto L1; } for (; sc; sc = sc.enclosing) { if (sc.scopesym && sc.scopesym.isDeprecated()) - return; + goto L1; // If inside a StorageClassDeclaration that is deprecated if (sc.stc & STC.STCdeprecated) - return; + goto L1; } error(loc, "is deprecated"); } + + L1: + Declaration d = isDeclaration(); + if (d && d.storage_class & STCdisable) + { + if (!(sc.func && sc.func.storage_class & STCdisable)) + { + if (d.ident == Id.cpctor && d.toParent()) + d.toParent().error(loc, "is not copyable"); + else + error(loc, "is not callable"); + } + } } Module getModule() @@ -896,6 +911,8 @@ DtorDeclaration isDtorDeclaration() { return null; } StaticCtorDeclaration isStaticCtorDeclaration() { return null; } StaticDtorDeclaration isStaticDtorDeclaration() { return null; } + SharedStaticCtorDeclaration isSharedStaticCtorDeclaration() { return null; } + SharedStaticDtorDeclaration isSharedStaticDtorDeclaration() { return null; } InvariantDeclaration isInvariantDeclaration() { return null; } UnitTestDeclaration isUnitTestDeclaration() { return null; } NewDeclaration isNewDeclaration() { return null; }