diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2023-01-09 11:14:05 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-15 11:36:41 +0200 |
commit | 83a0b4e7e345d05ad758d44d2a7121e1cc484f76 (patch) | |
tree | c7bc3a0b6fa7dac14811f88c9bb534cb69651556 /gcc/ada/sem_attr.adb | |
parent | f571a20192dceab5abce9303af4459f1917202f5 (diff) | |
download | gcc-83a0b4e7e345d05ad758d44d2a7121e1cc484f76.zip gcc-83a0b4e7e345d05ad758d44d2a7121e1cc484f76.tar.gz gcc-83a0b4e7e345d05ad758d44d2a7121e1cc484f76.tar.bz2 |
ada: Improve check of attribute reference
Before this patch, the front end failed to catch many illegal uses
of access attributes of task types.
This patch makes referring to the access attributes of a task type
raise an error, except in the current instance case defined in
clause 8.6 of the reference manual.
gcc/ada/
* sem_attr.adb: sem_attr.adb (Analyze_Access_Attribute): Tighten
validity check for task types.
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 9de9884..ac0c400 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1068,9 +1068,11 @@ package body Sem_Attr is Analyze (N); return; - -- OK if a task type, this test needs sharpening up ??? + -- OK if current task. - elsif Is_Task_Type (Typ) then + elsif Is_Task_Type (Typ) + and then In_Open_Scopes (Typ) + then null; -- OK if self-reference in an aggregate in Ada 2005, and |