aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-04-27 09:56:17 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-19 04:17:09 -0400
commit66bd7af5cca12b8f0470d1e8cf347ae2de1e928f (patch)
treea4e4feaa513bf71e70fd2a244fbf8c6baf2385ce
parent5af0271f0e983311b99493519af9863b58109ee3 (diff)
downloadgcc-66bd7af5cca12b8f0470d1e8cf347ae2de1e928f.zip
gcc-66bd7af5cca12b8f0470d1e8cf347ae2de1e928f.tar.gz
gcc-66bd7af5cca12b8f0470d1e8cf347ae2de1e928f.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.adb2
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);