aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2020-02-05 11:38:38 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-05 08:17:53 -0400
commitfaf250080011f5e92a6ba5ee5af22b12654992ba (patch)
treeaf14d3597f109baafdeb3fcc89b88d7ccf89e9f4 /gcc
parentbf44027a464e71142999f1ba454469fc80453fd9 (diff)
downloadgcc-faf250080011f5e92a6ba5ee5af22b12654992ba.zip
gcc-faf250080011f5e92a6ba5ee5af22b12654992ba.tar.gz
gcc-faf250080011f5e92a6ba5ee5af22b12654992ba.tar.bz2
[Ada] Subtype inherits Atomic flag from base type
2020-06-05 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): For scalar types, and for subtype declarations without a constraint, subtype inherits Atomic flag from base type.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch3.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 3c65a34..4d6382e 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -5804,6 +5804,15 @@ package body Sem_Ch3 is
end if;
end if;
+ -- If the base type is a scalar type, or else if there is no
+ -- constraint, the atomic flag is inherited by the subtype.
+
+ if Is_Scalar_Type (Id)
+ or else Is_Entity_Name (Subtype_Indication (N))
+ then
+ Set_Is_Atomic (Id, Is_Atomic (T));
+ end if;
+
-- Remaining processing depends on characteristics of base type
T := Etype (Id);