From: Piotr Trojanek Date: Mon, 27 Apr 2020 07:56:17 +0000 (+0200) Subject: [Ada] Fix validity checking for class-wide objects X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66bd7af5cca12b8f0470d1e8cf347ae2de1e928f;p=gcc.git [Ada] Fix validity checking for class-wide objects 2020-06-19 Piotr Trojanek gcc/ada/ * exp_attr.adb (Build_Record_VS_Func): Strip privacy and type derivation from the root type when 'Valid_Scalars is applied to a class-wide type. --- diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index f0f98bbc0ff..34fd9dc7a8e 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -737,7 +737,7 @@ package body Exp_Attr is -- Use the root type when dealing with a class-wide type if Is_Class_Wide_Type (Typ) then - Typ := Root_Type (Typ); + Typ := Validated_View (Root_Type (Typ)); end if; Typ_Decl := Declaration_Node (Typ);