The assertion fails because the Original_Node of the expression has no Etype
since its an unanalyzed identifier.
gcc/ada/
* accessibility.adb (Accessibility_Level): Apply the processing to
Expr when its Original_Node is an unanalyzed identifier.
-- Local variables
- E : Node_Id := Original_Node (Expr);
+ E : Node_Id;
Pre : Node_Id;
-- Start of processing for Accessibility_Level
if Present (Param_Entity (Expr)) then
E := Param_Entity (Expr);
+
+ -- Use the original node unless it is an unanalyzed identifier, as we
+ -- don't want to reason on unanalyzed expressions from predicates.
+
+ elsif Nkind (Original_Node (Expr)) /= N_Identifier
+ or else Analyzed (Original_Node (Expr))
+ then
+ E := Original_Node (Expr);
+
+ else
+ E := Expr;
end if;
-- Extract the entity