diff options
author | Ed Schonberg <schonberg@adacore.com> | 2019-12-18 07:14:54 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-18 07:14:54 +0000 |
commit | 64c6e3673a9eddf168fbe8d5cfab70f55fea08f8 (patch) | |
tree | 60d308f2111b2998bf13f5ee7dd243a0cc1d958b /gcc/ada/par-ch12.adb | |
parent | 2b0451b77242d8071aa3c2b077deb84c17170223 (diff) | |
download | gcc-64c6e3673a9eddf168fbe8d5cfab70f55fea08f8.zip gcc-64c6e3673a9eddf168fbe8d5cfab70f55fea08f8.tar.gz gcc-64c6e3673a9eddf168fbe8d5cfab70f55fea08f8.tar.bz2 |
[Ada] AI12-0282: shared variable control aspects on formal types
2019-12-18 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada_2020
the keyword WITH can indicate the start of aspect specifications
and not a private type extension.
* sem_ch12.adb (Analyze_Formal_Type): Indicate that it is a
first subtype.
(Instantiate_Type): New procedure
Check_Shared_Variable_Control_Aspects to verify matching rules
between formal and actual types. Note that an array type with
aspect Atomic_Components is considered compatible with an array
type whose component type is Atomic, even though the array types
do not carry the same aspect.
* sem_ch13.adb (Analyze_One_Aspect): Allow shared variable
control aspects to appear on formal types.
(Rep_Item_Too_Early): Exclude aspects on formal types.
* sem_prag.adb (Mark_Type): Handle properly pragmas that come
from aspects on formal types.
(Analyze_Pragma, case Atomic_Components): Handle formal types.
From-SVN: r279512
Diffstat (limited to 'gcc/ada/par-ch12.adb')
-rw-r--r-- | gcc/ada/par-ch12.adb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb index 3216927..0ecac2e 100644 --- a/gcc/ada/par-ch12.adb +++ b/gcc/ada/par-ch12.adb @@ -971,9 +971,16 @@ package body Ch12 is end if; if Token = Tok_With then - Scan; -- past WITH - Set_Private_Present (Def_Node, True); - T_Private; + + if Ada_Version >= Ada_2020 and Token /= Tok_Private then + -- Formal type has aspect specifications, parsed later. + return Def_Node; + + else + Scan; -- past WITH + Set_Private_Present (Def_Node, True); + T_Private; + end if; elsif Token = Tok_Tagged then Scan; |