Compiler doesn't complain about taking address of abstract method (but linker does)
Original Reporter info from Mantis: Hixie
-
Reporter name: Ian Hickson
Original Reporter info from Mantis: Hixie
- Reporter name: Ian Hickson
Description:
{$MODE OBJFPC}
type
TMyClass = class
procedure MyAbstractMethod(); virtual; abstract;
end;
var
Foo: Pointer;
begin
Foo := @TMyClass.MyAbstractMethod;
end.
Compiler is fine with it. Linker says:
undefined reference to `P$PROGRAM$_$TMYCLASS_$__$$_MYABSTRACTMETHOD'
Seems like the compiler shouldn't output code that the linker can't link.
Mantis conversion info:
- Mantis ID: 24536
- Build: 2013/05/04
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 25260 (#92811d09)