[Ada] Consistently use Validated_View for Valid_Scalars on records
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 7 Apr 2021 08:16:55 +0000 (10:16 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 29 Jun 2021 14:23:45 +0000 (14:23 +0000)
gcc/ada/

* exp_attr.adb (Expand_N_Attribute_Reference): Explicitly use
Validated_View for record objects.

gcc/ada/exp_attr.adb

index 400398d..d19ae1f 100644 (file)
@@ -7460,7 +7460,7 @@ package body Exp_Attr is
                     (Build_Record_VS_Func
                       (Attr       => N,
                        Formal_Typ => Ptyp,
-                       Rec_Typ    => Val_Typ),
+                       Rec_Typ    => Validated_View (Ptyp)),
                     Loc),
                 Parameter_Associations => New_List (Pref));
          end if;