Landing: 9bbec965c9b7
Project / Subsystem
gcc / ada
Date
2026-02-23
Author
Eric Botcazou
Commit
9bbec965c9b781b6e7733ff92012701b805ab084
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- ada
- patch_id
- —
- commit_hash
- 9bbec965c9b781b6e7733ff92012701b805ab084
- source_type
- github
- headline
- Raise Program_Error for 'Constrained attribute on unchecked union parameters
- tldr
- The Ada compiler now raises Program_Error for the 'Constrained attribute when applied to non-In formal parameters of unchecked union types.
- author
- Eric Botcazou
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • ada
- • unchecked union
- • program_error
- • gnat
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-02-23T00:00:00.000Z
GNAT historically hasn’t added extra formal parameters alongside formal parameters of unchecked union types, preventing computation of the ‘Constrained attribute for In Out or Out formal parameters. The compiler now raises Program_Error in these cases to enforce correct usage and prevent unexpected behavior. This change affects code that uses unchecked unions with the ‘Constrained attribute.