comparison dmd/attrib.c @ 710:20a5180f2e80

Make align(n), n != 1 an error.
author Christian Kamm <kamm incasoftware de>
date Sat, 18 Oct 2008 14:33:11 +0200
parents 6aaa3d3c1183
children b654bb98d31d
comparison
equal deleted inserted replaced
709:b972fb129d37 710:20a5180f2e80
490 AttribDeclaration::toCBuffer(buf, hgs); 490 AttribDeclaration::toCBuffer(buf, hgs);
491 } 491 }
492 492
493 /********************************* AlignDeclaration ****************************/ 493 /********************************* AlignDeclaration ****************************/
494 494
495 AlignDeclaration::AlignDeclaration(unsigned sa, Array *decl) 495 AlignDeclaration::AlignDeclaration(Loc loc, unsigned sa, Array *decl)
496 : AttribDeclaration(decl) 496 : AttribDeclaration(decl)
497 { 497 {
498 this->loc = loc;
498 salign = sa; 499 salign = sa;
500
501 if (salign != 1)
502 error("align(%d) is not implemented and specified to be unportable anyway, use align(1) and manual fillers instead", salign);
499 } 503 }
500 504
501 Dsymbol *AlignDeclaration::syntaxCopy(Dsymbol *s) 505 Dsymbol *AlignDeclaration::syntaxCopy(Dsymbol *s)
502 { 506 {
503 AlignDeclaration *ad; 507 AlignDeclaration *ad;
504 508
505 assert(!s); 509 assert(!s);
506 ad = new AlignDeclaration(salign, Dsymbol::arraySyntaxCopy(decl)); 510 ad = new AlignDeclaration(loc, salign, Dsymbol::arraySyntaxCopy(decl));
507 return ad; 511 return ad;
508 } 512 }
509 513
510 void AlignDeclaration::semantic(Scope *sc) 514 void AlignDeclaration::semantic(Scope *sc)
511 { 515 {