Is it possible to resolve the problem by tuning compiler options?
No, you cannot fix the error by tuning, it’s a (very specific) bug in the compiler.
[Can someone tell me] Whether this problem repeats at someone else?
I can reproduce the code, but only in XE2 update 4.
I was not able to check it in XE3 (don’t have that version).
It is fixed in XE4 (as per the comments).
So the only way to have the code to work is to:
a. remove the unneeded forward declaration.
b. use a different version of Delphi.