https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114636
Bug ID: 114636 Summary: Actual does not match formal in generic instantiation Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: simon at pushface dot org CC: dkm at gcc dot gnu.org Target Milestone: --- Created attachment 57899 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57899&action=edit example.adb Compiler can’t match an actual type with a formal. This appears to have been present from GCC 8.2, and is still present. Could it be related to PR24480? $ gnatmake -gnatl example.adb gcc -c -gnatl example.adb GNAT 13.2.1 Copyright 1992-2023, Free Software Foundation, Inc. Compiling: example.adb Source file time stamp: 2024-04-08 09:57:34 Compiled at: 2024-04-08 11:09:37 1. procedure Example is 2. generic 3. type Terminals is (<>); 4. type Nonterminals is (<>); 5. package Types is 6. type Action is record 7. data : Integer; 8. end record; 9. end Types; 10. 11. generic 12. type States is (<>); 13. type Input_T is (<>); 14. type Action_T is private; 15. package FSM is 16. end FSM; 17. 18. generic 19. with package Typs is new Types (<>); 20. with package SMs is new FSM 21. (States => <>, Input_T => Typs.Terminals, Action_T => Typs.Action); 22. package Gen is 23. end Gen; 24. 25. package Typs is new Types (Natural, Integer); 26. package SMs is new FSM (Integer, Natural, Typs.Action); 27. package Generator is new Gen (Typs, SMs); | >>> error: actual for "Action_T" in actual instance does not match formal 28. begin 29. null; 30. end Example; 30 lines: 1 error