From 23e28b42173b30e3ebe2b8e5765b01dc7fd60da2 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 21 May 2014 15:08:13 +0200 Subject: [PATCH] [multiple changes] 2014-05-21 Robert Dewar * sem_elab.adb, prj-dect.adb: Minor reformatting. 2014-05-21 Robert Dewar * erroutc.ads: Minor comment addition. 2014-05-21 Robert Dewar * errout.ads: Add documentation for use of >*> tag. * restrict.adb: Make sure we use >*> tag for restriction warnings. 2014-05-21 Gary Dismukes * debug.adb: Add case of illegal overriding_indicator for a protected subprogram body to description of -gnatd.E switch. * sem_ch6.adb (Verify_Overriding_Indicator): Issue error message for cases of giving overriding_indicators on protected subprogram bodies, but change this to a warning if -gnatd.E is enabled. No longer give a style warning about missing indicators on protected subprogram bodies. From-SVN: r210704 --- gcc/ada/ChangeLog | 23 +++++++++++++++++++++++ gcc/ada/debug.adb | 5 +++++ gcc/ada/errout.ads | 8 ++++---- gcc/ada/erroutc.ads | 4 ++++ gcc/ada/prj-dect.adb | 7 +++---- gcc/ada/restrict.adb | 8 ++++---- gcc/ada/sem_ch6.adb | 37 ++++++++++++++++++++++++++++++++----- gcc/ada/sem_elab.adb | 4 ++-- 8 files changed, 77 insertions(+), 19 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7729446..d65b3b0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,28 @@ 2014-05-21 Robert Dewar + * sem_elab.adb, prj-dect.adb: Minor reformatting. + +2014-05-21 Robert Dewar + + * erroutc.ads: Minor comment addition. + +2014-05-21 Robert Dewar + + * errout.ads: Add documentation for use of >*> tag. + * restrict.adb: Make sure we use >*> tag for restriction warnings. + +2014-05-21 Gary Dismukes + + * debug.adb: Add case of illegal overriding_indicator for a + protected subprogram body to description of -gnatd.E switch. + * sem_ch6.adb (Verify_Overriding_Indicator): Issue error message + for cases of giving overriding_indicators on protected subprogram + bodies, but change this to a warning if -gnatd.E is enabled. No + longer give a style warning about missing indicators on protected + subprogram bodies. + +2014-05-21 Robert Dewar + * prj.ads, sem_ch12.adb, prj.adb, exp_pakd.adb, sem_elab.ads: Minor reformatting. * erroutc.adb, erroutc.ads (Warning_Specifically_Suppressed): Make Tag diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index f2f118b..d5fae27 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -614,6 +614,11 @@ package body Debug is -- -- Errors relating to the new rules about not defining equality -- too late so that composition of equality can be assured. + -- + -- Errors relating to overriding indicators on protected subprogram + -- bodies (not an Ada 2012 incompatibility, but might cause errors + -- for existing programs assuming they were legal because GNAT + -- formerly allowed them). -- d.F Sets GNATprove_Mode to True. This allows debugging the frontend in -- the special mode used by GNATprove. diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index 8c561fb..a42d3db 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -312,10 +312,10 @@ package Errout is -- Insertion character < (Less Than: conditional warning message) -- The character < appearing anywhere in a message is used for a -- conditional error message. If Error_Msg_Warn is True, then the - -- effect is the same as ? described above, and in particular << and - -- &`#", N); end if; end Check_Restriction_No_Use_Of_Attribute; @@ -336,7 +336,7 @@ package body Restrict is Error_Msg_Node_1 := Id; Error_Msg_Warn := No_Use_Of_Pragma_Warning (P_Id); Error_Msg_N - (" &`#", Id); end if; end Check_Restriction_No_Use_Of_Pragma; @@ -645,7 +645,7 @@ package body Restrict is if No_Dependences.Table (J).Warn then Error_Msg - ("??violation of restriction `No_Dependence '='> &`#", + ("?*?violation of restriction `No_Dependence '='> &`#", Sloc (Err)); else Error_Msg @@ -691,7 +691,7 @@ package body Restrict is Error_Msg_Node_1 := Id; Error_Msg_Warn := No_Specification_Of_Aspect_Warning (A_Id); Error_Msg_N - (" &`#", Id); end if; end Check_Restriction_No_Specification_Of_Aspect; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 0c2bdf4..a3364b8 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -2782,6 +2782,16 @@ package body Sem_Ch6 is elsif not Present (Overridden_Operation (Spec_Id)) then Error_Msg_NE ("subprogram& is not overriding", Body_Spec, Spec_Id); + + -- Overriding indicators aren't allowed for protected subprogram + -- bodies (see the Confirmation in Ada Comment AC95-00213). Change + -- this to a warning if -gnatd.E is enabled. + + elsif Ekind (Scope (Spec_Id)) = E_Protected_Type then + Error_Msg_Warn := Error_To_Warning; + Error_Msg_N + ("