Landing: d90a3d5e91ba

Project / Subsystem

gcc / gcc/ada

Date

2026-05-14

Author

Eric Botcazou

Commit

d90a3d5e91baffcfea1797d5283542857750a617

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/ada
patch_id
commit_hash
d90a3d5e91baffcfea1797d5283542857750a617
source_type
github
headline
The Ada front end fixes missing error for deep access results in generics
tldr
The Ada front end now correctly identifies and flags errors when generic functions declare deeply nested access types, enforcing proper accessibility rules.
author
Eric Botcazou
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • ada
  • bugfix
  • type-safety
  • generics
discussion_id_link
bugzilla_pr
date
2026-05-14T00:00:00.000Z

This commit fixes a missing error detection in the Ada front end for cases where generic functions declare access results with too deep an accessibility level. The problem stemmed from the Is_Local_Anonymous_Access flag not being set correctly for anonymous access types in generic function specifications. The fix involves properly setting this flag in sem_ch12.adb during generic subprogram analysis, dealing with formal objects of generic subprograms in Accessibility_Level, and making corrections in the GNAT.CPP_Exceptions runtime unit to prevent illegal code and ensure proper handling of access-to-tagged-object declarations.