[Ada] Reject use of Relaxed_Initialization on scalar/access param or result
authorYannick Moy <moy@adacore.com>
Mon, 6 Jul 2020 12:58:28 +0000 (14:58 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 19 Oct 2020 09:53:38 +0000 (05:53 -0400)
commitbe8d605f16ed6ab090b411a7810911f4b7b7719a
treec2c4f1955130e421aaf2a2c61533325b8568ce6d
parent17ea7fad2830423188e2055708bb2d4a983c33bc
[Ada] Reject use of Relaxed_Initialization on scalar/access param or result

gcc/ada/

* sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): Fix bug
where a call to Error_Msg_N leads to crash due to
Error_Msg_Name_1 being removed by the call, while a subsequent
call to Error_Msg_N tries to use it. The variable
Error_Msg_Name_1 should be restored prior to the next call. Also
add checking for the new rules.
gcc/ada/sem_ch13.adb