comparison dmd/expression/Util.d @ 109:ceda59b4d255

expression.c changes, now only ddoc should be left
author Trass3r
date Tue, 31 Aug 2010 22:08:52 +0200
parents 5c859d5fbe27
children e28b18c23469
comparison
equal deleted inserted replaced
108:6da99741178e 109:ceda59b4d255
629 if (!(p.storageClass & STC.STClazy && p.type.ty == TY.Tvoid)) 629 if (!(p.storageClass & STC.STClazy && p.type.ty == TY.Tvoid))
630 { 630 {
631 if (p.type != arg.type) 631 if (p.type != arg.type)
632 { 632 {
633 //printf("arg.type = %s, p.type = %s\n", arg.type.toChars(), p.type.toChars()); 633 //printf("arg.type = %s, p.type = %s\n", arg.type.toChars(), p.type.toChars());
634 if (arg.op == TOKtype)
635 arg.error("cannot pass type %s as function argument", arg.toChars());
634 arg = arg.implicitCastTo(sc, p.type); 636 arg = arg.implicitCastTo(sc, p.type);
635 arg = arg.optimize(WANT.WANTvalue); 637 arg = arg.optimize(WANT.WANTvalue);
636 } 638 }
637 } 639 }
638 if (p.storageClass & STC.STCref) 640 if (p.storageClass & STC.STCref)
642 else if (p.storageClass & STC.STCout) 644 else if (p.storageClass & STC.STCout)
643 { 645 {
644 arg = arg.modifiableLvalue(sc, arg); 646 arg = arg.modifiableLvalue(sc, arg);
645 } 647 }
646 648
649 tb = arg.type.toBasetype();
650 version(SARRAYVALUE) {} else
651 {
647 // Convert static arrays to pointers 652 // Convert static arrays to pointers
648 tb = arg.type.toBasetype();
649 if (tb.ty == TY.Tsarray) 653 if (tb.ty == TY.Tsarray)
650 { 654 {
651 arg = arg.checkToPointer(); 655 arg = arg.checkToPointer();
652 } 656 }
657 }
653 version (DMDV2) { 658 version (DMDV2) {
654 if (tb.ty == TY.Tstruct && !(p.storageClass & (STC.STCref | STC.STCout))) 659 if (tb.ty == TY.Tstruct && !(p.storageClass & (STC.STCref | STC.STCout)))
655 { 660 {
656 arg = callCpCtor(loc, sc, arg); 661 arg = callCpCtor(loc, sc, arg);
657 } 662 }