]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Reject component-related aspects on formal non-array types
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 17 Mar 2025 12:20:53 +0000 (13:20 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 9 Jun 2025 08:23:59 +0000 (10:23 +0200)
commit6cc5c01aa77a1f01057a963cc5061bad4b0cc270
tree8777282f23c8897c2160287e999dd2d02dcd8588
parent2fd267be72dfb0dbaa422c21888a40e69173defa
ada: Reject component-related aspects on formal non-array types

In Ada 2022 aspects Atomic_Components and Volatile_Components can be specified
for a formal array type, but they were wrongly accepted on any formal type.

Also, we don't need to check if the corresponding pragmas appear in Ada 2022
mode, because generic formal parameters can't have explicit representation
pragmas in any Ada version and can only have aspects since Ada 2022.

gcc/ada/ChangeLog:

* sem_prag.adb (Analyze_Pragma): Fix conditions for legality checks on
formal type declarations.
gcc/ada/sem_prag.adb