From 66bd7af5cca12b8f0470d1e8cf347ae2de1e928f Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 27 Apr 2020 09:56:17 +0200 Subject: [PATCH] [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. --- gcc/ada/exp_attr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index f0f98bb..34fd9dc 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); -- 2.7.4