aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-12-03 12:01:14 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2022-01-06 17:11:34 +0000
commit0590ed7248a46c06c9f0d166af7eb8c9bb046a66 (patch)
tree72f4ed5ca2eab8b298f3822b2635f0cb42627346 /gcc/ada/sem_attr.adb
parent337417795afd624c479c49529a935ee096700457 (diff)
downloadgcc-0590ed7248a46c06c9f0d166af7eb8c9bb046a66.zip
gcc-0590ed7248a46c06c9f0d166af7eb8c9bb046a66.tar.gz
gcc-0590ed7248a46c06c9f0d166af7eb8c9bb046a66.tar.bz2
[Ada] New restriction No_Tagged_Type_Registration
gcc/ada/ * libgnat/s-rident.ads (No_Tagged_Type_Registration): New restriction identifier. * restrict.ads (Implementation_Restriction): Add restriction. * exp_ch7.adb (Process_Declarations): Suppress tagged-type-related finalization actions if the restriction is active. Call RTE_Available last. * exp_disp.adb (Make_DT): Likewise. * exp_util.adb (Requires_Cleanup_Actions): Return False for a tagged type declaration if No_Tagged_Type_Registration is active. * sem_attr.adb (Check_Stream_Attribute): Check restriction No_Tagged_Type_Registration. * libgnat/a-except.ads (Null_Occurrence): Minor: Initialize, to avoid stopping at a warning in gdb. * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Document new restriction. * gnat_rm.texi: Regenerate.
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 2cd8c14..4344885 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -2622,6 +2622,15 @@ package body Sem_Attr is
Check_Restriction (No_Exception_Registration, P);
end if;
+ -- If the No_Tagged_Type_Registration restriction is active, then
+ -- class-wide streaming attributes are not allowed.
+
+ if Restriction_Check_Required (No_Tagged_Type_Registration)
+ and then Is_Class_Wide_Type (P_Type)
+ then
+ Check_Restriction (No_Tagged_Type_Registration, P);
+ end if;
+
-- Here we must check that the first argument is an access type
-- that is compatible with Ada.Streams.Root_Stream_Type'Class.