[Ada] Fix validity checking for class-wide objects

2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

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.
This commit is contained in:
Piotr Trojanek 2020-04-27 09:56:17 +02:00 committed by Pierre-Marie de Rodat
parent 5af0271f0e
commit 66bd7af5cc

View File

@ -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);