Ada 2022 errors about volatile compatibility between generic actual and
formal types were emitted on type declaration; now they are emitted at
the actual type within the generic instance.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Errors
        emitted via Check_Volatility_Compatibility are now emitted at
        Actual, just like other errors emitted by
        Check_Shared_Variable_Control_Aspects.
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -12825,7 +12825,7 @@ package body Sem_Ch12 is
             Check_Volatility_Compatibility
               (Act_T, A_Gen_T,
                "actual type", "its corresponding formal type",
-               Srcpos_Bearer => Act_T);
+               Srcpos_Bearer => Actual);
          end if;
       end Check_Shared_Variable_Control_Aspects;
 


Reply via email to