end if;
Resolve (Prefix (P));
+ Resolve_Implicit_Dereference (Prefix (P));
if not Is_Overloaded (P) then
Generate_Reference (Entity (Selector_Name (P)), P);
-- is the context type, which is used when the operation is a protected
-- function with no arguments, and the return value is indexed.
- procedure Resolve_Implicit_Dereference (P : Node_Id);
- -- Called when P is the prefix of an indexed component, or of a selected
- -- component, or of a slice. If P is of an access type, we unconditionally
- -- rewrite it as an explicit dereference. This ensures that the expander
- -- and the code generator have a fully explicit tree to work with.
-
procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id);
-- A call to a user-defined intrinsic operator is rewritten as a call to
-- the corresponding predefined operator, with suitable conversions. Note
-- own type. For now we assume that the prefix cannot be overloaded and
-- the name of the entry plays no role in the resolution.
+ procedure Resolve_Implicit_Dereference (P : Node_Id);
+ -- Called when P is the prefix of an indexed component, or of a selected
+ -- component, or of a slice. If P is of an access type, we unconditionally
+ -- rewrite it as an explicit dereference. This ensures that the expander
+ -- and the code generator have a fully explicit tree to work with.
+
procedure Resolve_Membership_Equality (N : Node_Id; Typ : Entity_Id);
-- Resolve the equality operator in an individual membership test
--- /dev/null
+-- { dg-do run }
+
+with Ada.Text_IO;
+
+procedure Protected_Deref1 is
+
+ protected type Fallback_Hit_Counter_Type is
+ procedure Handler;
+ end Fallback_Hit_Counter_Type;
+
+ protected body Fallback_Hit_Counter_Type is
+ procedure Handler is
+ begin
+ Ada.Text_IO.Put_Line ("Test");
+ end Handler;
+ end Fallback_Hit_Counter_Type;
+
+ Fallback_Hit_Counter : access Fallback_Hit_Counter_Type :=
+ new Fallback_Hit_Counter_Type;
+
+ type X is access protected procedure;
+
+ A : X := Fallback_Hit_Counter.all.Handler'Access;
+ B : X := Fallback_Hit_Counter.Handler'Access;
+
+begin
+ A.all;
+ B.all;
+ if A /= B then
+ raise Program_Error;
+ end if;
+end;