aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2020-08-23 13:38:16 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-22 08:11:24 -0400
commitd302be6eba3f7c09ca01496fd2172c6aeb8967b3 (patch)
treea442b72b373537fb6ac0df729cbf402b684225f4 /gcc/ada
parent67a3b519af65068c5ad8173373068929b99a3912 (diff)
downloadgcc-d302be6eba3f7c09ca01496fd2172c6aeb8967b3.zip
gcc-d302be6eba3f7c09ca01496fd2172c6aeb8967b3.tar.gz
gcc-d302be6eba3f7c09ca01496fd2172c6aeb8967b3.tar.bz2
[Ada] Wrong accessibility for conversion to named access
gcc/ada/ * sem_util.adb (Accessibility_Level_Helper): Conversions to named access types get the level associated with the named access type.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_util.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 30c5376..89c3f48 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -751,6 +751,13 @@ package body Sem_Util is
then
return Accessibility_Level_Helper (Expression (E), Static);
+ -- We don't care about the master if we are looking at a named
+ -- access type.
+
+ elsif Is_Named_Access_Type (Etype (E)) then
+ return Make_Level_Literal
+ (Type_Access_Level (Etype (E)));
+
-- In section RM 3.10.2 (10/4) the accessibility rules for
-- aggregates and value conversions are outlined. Are these
-- followed in the case of initialization of an object ???