Mercurial > projects > ddmd
comparison dmd/Dsymbol.d @ 179:cd48cb899aee
Updated to dmd2.040
author | korDen |
---|---|
date | Sun, 17 Oct 2010 20:56:07 +0400 |
parents | e3afd1303184 |
children | b0d41ff5e0df |
comparison
equal
deleted
inserted
replaced
178:e3afd1303184 | 179:cd48cb899aee |
---|---|
10 import dmd.ScopeDsymbol; | 10 import dmd.ScopeDsymbol; |
11 import dmd.OutBuffer; | 11 import dmd.OutBuffer; |
12 import dmd.Id; | 12 import dmd.Id; |
13 import dmd.Identifier; | 13 import dmd.Identifier; |
14 import dmd.TemplateInstance; | 14 import dmd.TemplateInstance; |
15 import dmd.SharedStaticCtorDeclaration; | |
16 import dmd.SharedStaticDtorDeclaration; | |
15 import dmd.HdrGenState; | 17 import dmd.HdrGenState; |
16 import dmd.AggregateDeclaration; | 18 import dmd.AggregateDeclaration; |
17 import dmd.ClassDeclaration; | 19 import dmd.ClassDeclaration; |
18 import dmd.LabelDsymbol; | 20 import dmd.LabelDsymbol; |
19 import dmd.Type; | 21 import dmd.Type; |
248 { | 250 { |
249 // Don't complain if we're inside a deprecated symbol's scope | 251 // Don't complain if we're inside a deprecated symbol's scope |
250 for (Dsymbol sp = sc.parent; sp; sp = sp.parent) | 252 for (Dsymbol sp = sc.parent; sp; sp = sp.parent) |
251 { | 253 { |
252 if (sp.isDeprecated()) | 254 if (sp.isDeprecated()) |
253 return; | 255 goto L1; |
254 } | 256 } |
255 | 257 |
256 for (; sc; sc = sc.enclosing) | 258 for (; sc; sc = sc.enclosing) |
257 { | 259 { |
258 if (sc.scopesym && sc.scopesym.isDeprecated()) | 260 if (sc.scopesym && sc.scopesym.isDeprecated()) |
259 return; | 261 goto L1; |
260 | 262 |
261 // If inside a StorageClassDeclaration that is deprecated | 263 // If inside a StorageClassDeclaration that is deprecated |
262 if (sc.stc & STC.STCdeprecated) | 264 if (sc.stc & STC.STCdeprecated) |
263 return; | 265 goto L1; |
264 } | 266 } |
265 | 267 |
266 error(loc, "is deprecated"); | 268 error(loc, "is deprecated"); |
269 } | |
270 | |
271 L1: | |
272 Declaration d = isDeclaration(); | |
273 if (d && d.storage_class & STCdisable) | |
274 { | |
275 if (!(sc.func && sc.func.storage_class & STCdisable)) | |
276 { | |
277 if (d.ident == Id.cpctor && d.toParent()) | |
278 d.toParent().error(loc, "is not copyable"); | |
279 else | |
280 error(loc, "is not callable"); | |
281 } | |
267 } | 282 } |
268 } | 283 } |
269 | 284 |
270 Module getModule() | 285 Module getModule() |
271 { | 286 { |
894 CtorDeclaration isCtorDeclaration() { return null; } | 909 CtorDeclaration isCtorDeclaration() { return null; } |
895 PostBlitDeclaration isPostBlitDeclaration() { return null; } | 910 PostBlitDeclaration isPostBlitDeclaration() { return null; } |
896 DtorDeclaration isDtorDeclaration() { return null; } | 911 DtorDeclaration isDtorDeclaration() { return null; } |
897 StaticCtorDeclaration isStaticCtorDeclaration() { return null; } | 912 StaticCtorDeclaration isStaticCtorDeclaration() { return null; } |
898 StaticDtorDeclaration isStaticDtorDeclaration() { return null; } | 913 StaticDtorDeclaration isStaticDtorDeclaration() { return null; } |
914 SharedStaticCtorDeclaration isSharedStaticCtorDeclaration() { return null; } | |
915 SharedStaticDtorDeclaration isSharedStaticDtorDeclaration() { return null; } | |
899 InvariantDeclaration isInvariantDeclaration() { return null; } | 916 InvariantDeclaration isInvariantDeclaration() { return null; } |
900 UnitTestDeclaration isUnitTestDeclaration() { return null; } | 917 UnitTestDeclaration isUnitTestDeclaration() { return null; } |
901 NewDeclaration isNewDeclaration() { return null; } | 918 NewDeclaration isNewDeclaration() { return null; } |
902 VarDeclaration isVarDeclaration() { return null; } | 919 VarDeclaration isVarDeclaration() { return null; } |
903 ClassDeclaration isClassDeclaration() { return null; } | 920 ClassDeclaration isClassDeclaration() { return null; } |