Message ID | 20210428094140.GA140164@adacore.com |
---|---|
State | New |
Headers | show |
Series | [Ada] Fix recent optimization in evaluation of selected component for GNATprove | expand |
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -3849,7 +3849,9 @@ package body Sem_Eval is Node := Unqualify (Prefix (N)); - if Nkind (Node) = N_Aggregate then + if Nkind (Node) = N_Aggregate + and then Compile_Time_Known_Aggregate (Node) + then Comp := First (Component_Associations (Node)); Nam := Chars (Selector_Name (N));