aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2020-12-11 01:01:11 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-04-29 04:00:43 -0400
commit2d98b9a9a8a4a5eb3f361b7e5fc06b7041ba45e6 (patch)
tree422701ba8c8e462c4aa668bff37ef60b02608db2 /gcc
parent2baa4614c8f91015f06b69f09f3ce6360a77c5a8 (diff)
downloadgcc-2d98b9a9a8a4a5eb3f361b7e5fc06b7041ba45e6.zip
gcc-2d98b9a9a8a4a5eb3f361b7e5fc06b7041ba45e6.tar.gz
gcc-2d98b9a9a8a4a5eb3f361b7e5fc06b7041ba45e6.tar.bz2
[Ada] Warning for 'Class applied to untagged incomplete type
gcc/ada/ * sem_ch8.adb (Find_Type): Check the No_Obsolescent_Features restriction for 'Class applied to an untagged incomplete type (when Ada_Version >= Ada_2005). Remove disabling of the warning message for such usage, along with the ??? comment, which no longer applies (because the -gnatg switch no longer sets Warn_On_Obsolescent_Feature).
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch8.adb20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index efff714..cf5b790 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -7893,16 +7893,18 @@ package body Sem_Ch8 is
Set_Entity (N, Any_Type);
return;
- -- ??? This test is temporarily disabled (always
- -- False) because it causes an unwanted warning on
- -- GNAT sources (built with -gnatg, which includes
- -- Warn_On_Obsolescent_ Feature). Once this issue
- -- is cleared in the sources, it can be enabled.
+ else
+ if Restriction_Check_Required (No_Obsolescent_Features)
+ then
+ Check_Restriction
+ (No_Obsolescent_Features, Prefix (N));
+ end if;
- elsif Warn_On_Obsolescent_Feature and then False then
- Error_Msg_N
- ("applying ''Class to an untagged incomplete type"
- & " is an obsolescent feature (RM J.11)?r?", N);
+ if Warn_On_Obsolescent_Feature then
+ Error_Msg_N
+ ("applying ''Class to an untagged incomplete type"
+ & " is an obsolescent feature (RM J.11)?r?", N);
+ end if;
end if;
end if;