aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-12-04 16:26:45 +0100
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-01-03 16:39:13 +0100
commit299c1045a22564ea54a2f37d01e198df8eddf0a9 (patch)
tree5457da37732bfc811b16569a9c7919f8aa166d16 /gcc
parentc1d22d40490a5b0e2429f0c206e53c8f95948b30 (diff)
downloadgcc-299c1045a22564ea54a2f37d01e198df8eddf0a9.zip
gcc-299c1045a22564ea54a2f37d01e198df8eddf0a9.tar.gz
gcc-299c1045a22564ea54a2f37d01e198df8eddf0a9.tar.bz2
ada: Simplify check for No_Coextensions restriction
Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Alocator): Move unrelated code out of a declare block.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_res.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 27309b2..889cbd3 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -5821,13 +5821,13 @@ package body Sem_Res is
and then Nkind (Associated_Node_For_Itype (Typ)) =
N_Discriminant_Specification
then
+ Check_Restriction (No_Coextensions, N);
+
declare
Discr : constant Entity_Id :=
Defining_Identifier (Associated_Node_For_Itype (Typ));
begin
- Check_Restriction (No_Coextensions, N);
-
-- Ada 2012 AI05-0052: If the designated type of the
-- allocator is limited, then the allocator shall not
-- be used to define the value of an access discriminant