tw0555.pp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. { %CPU=i386 }
  2. { FPC behaves interestingly once encountered virtual method
  3. declared as
  4. procedure TWhateverObject.Method1; assembler; asm ... end;
  5. if you ever try to overload such method _in another unit_,
  6. than compile _second unit_, and than try to compile it again (???)-
  7. you will end up with the message "Function header does not match
  8. forward declaration of TNewObject.Method1" although in reality
  9. it does match perfectly.
  10. sometimes i encounter the same message even on non-assembler methods,
  11. but i have not been able to reproduce them cleanly nor find the
  12. reason for such behavior.}
  13. unit tw0555;
  14. interface
  15. uses
  16. uw0555;
  17. type
  18. TBugObjChild = Object(TBugObj)
  19. procedure Method1;
  20. procedure Method2;virtual;
  21. procedure Method3;
  22. procedure Method4;virtual;
  23. end;
  24. implementation
  25. procedure TBugObjChild.Method1;
  26. begin
  27. end;
  28. procedure TBugObjChild.Method2;
  29. begin
  30. end;
  31. {$ASMMODE ATT}
  32. procedure TBugObjChild.Method3;assembler;
  33. asm
  34. movl $1,%eax
  35. end;
  36. procedure TBugObjChild.Method4;assembler;
  37. asm
  38. movl $1,%eax
  39. end;
  40. end.