tbug555.pp 1.1 KB

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