Mercurial > projects > ddmd
comparison dmd/DeleteDeclaration.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 |
---|---|
41 return f; | 41 return f; |
42 } | 42 } |
43 | 43 |
44 override void semantic(Scope sc) | 44 override void semantic(Scope sc) |
45 { | 45 { |
46 ClassDeclaration cd; | |
47 | |
48 //printf("DeleteDeclaration.semantic()\n"); | 46 //printf("DeleteDeclaration.semantic()\n"); |
49 | 47 |
50 parent = sc.parent; | 48 parent = sc.parent; |
51 Dsymbol parent = toParent(); | 49 Dsymbol parent = toParent(); |
52 cd = parent.isClassDeclaration(); | 50 ClassDeclaration cd = parent.isClassDeclaration(); |
53 if (!cd && !parent.isStructDeclaration()) | 51 if (!cd && !parent.isStructDeclaration()) |
54 { | 52 { |
55 error("new allocators only are for class or struct definitions"); | 53 error("new allocators only are for class or struct definitions"); |
56 } | 54 } |
57 type = new TypeFunction(arguments, Type.tvoid, 0, LINKd); | 55 if (!type) |
56 type = new TypeFunction(arguments, Type.tvoid, 0, LINKd); | |
58 | 57 |
59 type = type.semantic(loc, sc); | 58 type = type.semantic(loc, sc); |
60 assert(type.ty == Tfunction); | 59 assert(type.ty == Tfunction); |
61 | 60 |
62 // Check that there is only one argument of type void* | 61 // Check that there is only one argument of type void* |