From: Piotr Trojanek Date: Mon, 25 Oct 2021 19:15:58 +0000 (+0200) Subject: [Ada] Fix detection of array aggregates with single others associations X-Git-Tag: basepoints/gcc-13~3295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51ad879c72e77f8a4021256c4aaf5567c6f587cf;p=thirdparty%2Fgcc.git [Ada] Fix detection of array aggregates with single others associations gcc/ada/ * checks.adb (Apply_Constraint_Check): Guard against calling Choices when the first association in an array aggregate is a N_Iterated_Component_Association node. --- diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index bbccab765c05..6fb33b45ae94 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -1388,6 +1388,8 @@ package body Checks is if Nkind (N) = N_Aggregate and then No (Expressions (N)) + and then Nkind (First (Component_Associations (N))) = + N_Component_Association and then Nkind (First (Choices (First (Component_Associations (N))))) = N_Others_Choice