From: Yannick Moy Date: Fri, 6 Nov 2020 17:09:44 +0000 (+0100) Subject: [Ada] Add continuation message when others choice not allowed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f456de4c432c6f44cc0de9ccc19a4ff4eadb8f9c;p=gcc.git [Ada] Add continuation message when others choice not allowed gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Improve error message. --- diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 1ba58701f03..5a1f8c49b8f 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1870,10 +1870,15 @@ package body Sem_Aggr is -- Test for the validity of an others choice if present if Others_Present and then not Others_Allowed then - Error_Msg_N - ("OTHERS choice not allowed here", - First (Choice_List (First (Component_Associations (N))))); - return Failure; + declare + Others_N : constant Node_Id := + First (Choice_List (First (Component_Associations (N)))); + begin + Error_Msg_N ("OTHERS choice not allowed here", Others_N); + Error_Msg_N ("\qualify the aggregate with a constrained subtype " + & "to provide bounds for it", Others_N); + return Failure; + end; end if; -- Protect against cascaded errors