https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113862
Bug ID: 113862 Summary: error: "others" choice not allowed here Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: p.p11 at orange dot fr CC: dkm at gcc dot gnu.org Target Milestone: --- Created attachment 57376 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57376&action=edit Reproducer. $ gcc -c -gnatl test34b.adb GNAT 13.2.0 Compiling: test34b.adb 1. procedure Test34b is 2. 3. type NTCT is new Natural; 4. TBD_Error, Not_Valid_Error : exception; 5. function Is_Valid (P : NTCT) return Boolean is (False); 6. Param : NTCT; 7. type Some_Tagged is tagged null record; 8. type A_Tagged is new Some_Tagged with record Comp : Character; end record; 9. type Some_Array is array (Positive range <>) of NTCT; 10. function Func (Val : Integer) return Natural is (0); 11. 12. -- Section_11_3_Paragraph_2a 13. Pre : Boolean := (if not Is_Valid(Param) then raise Not_Valid_Error); 14. A : A_Tagged := (Some_Tagged'(raise TBD_Error) with Comp => 'A'); 15. B : Some_Array := (1, 2, 3, others => raise Not_Valid_Error); | >>> error: "others" choice not allowed here >>> error: qualify the aggregate with a constrained subtype to provide bounds for it 16. C : Natural := Func (Val => raise TBD_Error); 17. D : A_Tagged := ((raise TBD_Error) with Comp => 'A'); 18. 19. begin 20. null; 21. end; It is weird as this code comes from AARM 2022 Section_11_3_Paragraph_2a. See full source code in attachement.