According to RM 9.4(21/2), within the declaration or body of a
protected object other than in an access_definition, the name of
the protected type denotes the current instance.
This patch allows attributes to be applied properly in this case.
The prefix is rewritten to the current instance when appropriate,
and an error message is issued when an instance is used instead
of a type.
The "protected_self_ref1.adb" should compile and run without error,
while "protected_self_ref2.adb" will issue the following error:
12. D := P'Digits;
|
>>> prefix of "Digits" attribute denotes current instance (RM 9.4(21/2))
Tested on i686-pc-linux-gnu. Ok for trunk?