https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67205
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Unnecessary trampolines for |violation of |nested packages |No_Implicit_Dynamic_Code | |restriction not reported --- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > The attached example requires generation of trampolines. This may be due to > bug 57999, but I think a front-end fix would be more reliable. Please clarify "front-end fix". The language requires pointers to nested functions in this case and you cannot reasonably change that, nested functions being first-class citizens in Ada. More generally, trampolines can indeed be eliminated, but you need changes in the entire compiler to do it. > As an additional surprise, pragma Restrictions (No_Implicit_Dynamic_Code) > does not cause compilation to fail. The error is only detected at binding > time, and -Wtrampolines is needed to find the culprit. Yes, the violation is detected but the error is not issued, probably because it's the instantiation of a run-time unit.