comparison dmd/AttribDeclaration.d @ 82:e95073e26356

fixed a hack I used as a lack of copy ctor in D
author korDen
date Mon, 30 Aug 2010 18:38:35 +0400
parents 43073c7c7769
children e28b18c23469
comparison
equal deleted inserted replaced
81:722df8e7509c 82:e95073e26356
45 { 45 {
46 Scope newsc = sc; 46 Scope newsc = sc;
47 if (stc != sc.stc || linkage != sc.linkage || protection != sc.protection || explicitProtection != sc.explicitProtection || structalign != sc.structalign) 47 if (stc != sc.stc || linkage != sc.linkage || protection != sc.protection || explicitProtection != sc.explicitProtection || structalign != sc.structalign)
48 { 48 {
49 // create new one for changes 49 // create new one for changes
50 newsc = new Scope(sc); 50 newsc = sc.clone();
51 newsc.offset = sc.offset;
52 newsc.scopesym = sc.scopesym;
53 newsc.flags &= ~SCOPE.SCOPEfree; 51 newsc.flags &= ~SCOPE.SCOPEfree;
54 newsc.stc = stc; 52 newsc.stc = stc;
55 newsc.linkage = linkage; 53 newsc.linkage = linkage;
56 newsc.protection = protection; 54 newsc.protection = protection;
57 newsc.explicitProtection = explicitProtection; 55 newsc.explicitProtection = explicitProtection;
73 { 71 {
74 Scope newsc = sc; 72 Scope newsc = sc;
75 if (stc != sc.stc || linkage != sc.linkage || protection != sc.protection || explicitProtection != sc.explicitProtection || structalign != sc.structalign) 73 if (stc != sc.stc || linkage != sc.linkage || protection != sc.protection || explicitProtection != sc.explicitProtection || structalign != sc.structalign)
76 { 74 {
77 // create new one for changes 75 // create new one for changes
78 newsc = new Scope(sc); 76 newsc = sc.clone();
79 newsc.offset = sc.offset;
80 newsc.scopesym = sc.scopesym;
81 newsc.flags &= ~SCOPE.SCOPEfree; 77 newsc.flags &= ~SCOPE.SCOPEfree;
82 newsc.stc = stc; 78 newsc.stc = stc;
83 newsc.linkage = linkage; 79 newsc.linkage = linkage;
84 newsc.protection = protection; 80 newsc.protection = protection;
85 newsc.explicitProtection = explicitProtection; 81 newsc.explicitProtection = explicitProtection;