diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-04-27 09:56:17 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:14:05 -0300 |
commit | 092d63c0fb681013eef475fccdac2d44181120e3 (patch) | |
tree | c0d957b210ab8f90ed702794786751028073ec23 | |
parent | ab785b5d963ca82437aca35bdf820bd63e2e01d5 (diff) | |
download | gcc-092d63c0fb681013eef475fccdac2d44181120e3.zip gcc-092d63c0fb681013eef475fccdac2d44181120e3.tar.gz gcc-092d63c0fb681013eef475fccdac2d44181120e3.tar.bz2 |
[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.
-rw-r--r-- | gcc/ada/exp_attr.adb | 2 |
1 files changed, 1 insertions, 1 deletions
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); |