diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-05-21 15:08:13 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-05-21 15:08:13 +0200 |
commit | 23e28b42173b30e3ebe2b8e5765b01dc7fd60da2 (patch) | |
tree | 975fd0944fae6262222dccf289f20d09a24008ef /gcc | |
parent | b7b92f15d30a1cae3d59af69dad849fe4025f24f (diff) | |
download | gcc-23e28b42173b30e3ebe2b8e5765b01dc7fd60da2.zip gcc-23e28b42173b30e3ebe2b8e5765b01dc7fd60da2.tar.gz gcc-23e28b42173b30e3ebe2b8e5765b01dc7fd60da2.tar.bz2 |
[multiple changes]
2014-05-21 Robert Dewar <dewar@adacore.com>
* sem_elab.adb, prj-dect.adb: Minor reformatting.
2014-05-21 Robert Dewar <dewar@adacore.com>
* erroutc.ads: Minor comment addition.
2014-05-21 Robert Dewar <dewar@adacore.com>
* errout.ads: Add documentation for use of >*> tag.
* restrict.adb: Make sure we use >*> tag for restriction warnings.
2014-05-21 Gary Dismukes <dismukes@adacore.com>
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 23 | ||||
-rw-r--r-- | gcc/ada/debug.adb | 5 | ||||
-rw-r--r-- | gcc/ada/errout.ads | 8 | ||||
-rw-r--r-- | gcc/ada/erroutc.ads | 4 | ||||
-rw-r--r-- | gcc/ada/prj-dect.adb | 7 | ||||
-rw-r--r-- | gcc/ada/restrict.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 37 | ||||
-rw-r--r-- | 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 <dewar@adacore.com> + * sem_elab.adb, prj-dect.adb: Minor reformatting. + +2014-05-21 Robert Dewar <dewar@adacore.com> + + * erroutc.ads: Minor comment addition. + +2014-05-21 Robert Dewar <dewar@adacore.com> + + * errout.ads: Add documentation for use of >*> tag. + * restrict.adb: Make sure we use >*> tag for restriction warnings. + +2014-05-21 Gary Dismukes <dismukes@adacore.com> + + * 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 <dewar@adacore.com> + * 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 - -- <X< have the effect of ?? and ?X? respectively. If Error_Msg_Warn - -- is False, then the < << or <X< sequence is ignored and the message - -- is treated as a error rather than a warning. + -- effect is the same as ? described above, and in particular << + -- <X< and <*< have the effect of ?? ?X? and ?*? respectively. If + -- Error_Msg_Warn is False, then the < << or <X< sequence is ignored + -- and the message is treated as a error rather than a warning. -- Insertion character A-Z (Upper case letter: Ada reserved word) -- If two or more upper case letters appear in the message, they are diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads index 96ac676..c638aac 100644 --- a/gcc/ada/erroutc.ads +++ b/gcc/ada/erroutc.ads @@ -564,6 +564,10 @@ package Erroutc is -- the corresponding warning string is returned (or the null string if no -- Warning argument was present in the pragma). Tag is the error message -- tag for the message in question or the null string if there is no tag. + -- + -- Note: we have a null default for Tag to deal with calls from an old + -- branch of gnat2why, which does not know about tags in the calls but + -- which uses the latest version of erroutc. function Warning_Treated_As_Error (Msg : String) return Boolean; -- Returns True if the warning message Msg matches any of the strings diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb index dafe882..a4d07d8 100644 --- a/gcc/ada/prj-dect.adb +++ b/gcc/ada/prj-dect.adb @@ -215,10 +215,9 @@ package body Prj.Dect is Name : constant Name_Id := Name_Of (Current_Package, In_Tree); begin if (Qualif = Aggregate and then Name /= Snames.Name_Builder) - or else - (Qualif = Aggregate_Library - and then Name /= Snames.Name_Builder - and then Name /= Snames.Name_Install) + or else (Qualif = Aggregate_Library + and then Name /= Snames.Name_Builder + and then Name /= Snames.Name_Install) then Error_Msg_Name_1 := Name; Error_Msg diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index abf294a..78591c1 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -303,7 +303,7 @@ package body Restrict is Error_Msg_Node_1 := N; Error_Msg_Warn := No_Use_Of_Attribute_Warning (A_Id); Error_Msg_N - ("<violation of restriction `No_Use_Of_Attribute '='> &`#", N); + ("<*<violation of restriction `No_Use_Of_Attribute '='> &`#", 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 - ("<violation of restriction `No_Use_Of_Pragma '='> &`#", Id); + ("<*<violation of restriction `No_Use_Of_Pragma '='> &`#", 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 - ("<violation of restriction `No_Specification_Of_Aspect '='> &`#", + ("<*<violation of restriction `No_Specification_Of_Aspect '='> &`#", 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 + ("<overriding indicator not allowed for protected " + & "subprogram body", Body_Spec); end if; elsif Must_Not_Override (Body_Spec) then @@ -2797,20 +2807,37 @@ package body Sem_Ch6 is ("subprogram & overrides predefined operator ", Body_Spec, Spec_Id); - -- If this is not a primitive operation or protected subprogram, - -- then the overriding indicator is altogether illegal. + -- 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; - elsif not Is_Primitive (Spec_Id) - and then Ekind (Scope (Spec_Id)) /= E_Protected_Type - then + Error_Msg_N + ("<overriding indicator not allowed " & + "for protected subprogram body", + Body_Spec); + + -- If this is not a primitive operation, then the overriding + -- indicator is altogether illegal. + + elsif not Is_Primitive (Spec_Id) then Error_Msg_N ("overriding indicator only allowed " & "if subprogram is primitive", Body_Spec); end if; + -- If checking the style rule and the operation overrides, then + -- issue a warning about a missing overriding_indicator. Protected + -- subprogram bodies are excluded from this style checking, since + -- they aren't primitives (even though their declarations can + -- override) and aren't allowed to have an overriding_indicator. + elsif Style_Check and then Present (Overridden_Operation (Spec_Id)) + and then Ekind (Scope (Spec_Id)) /= E_Protected_Type then pragma Assert (Unit_Declaration_Node (Body_Id) = N); Style.Missing_Overriding (N, Body_Id); diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 8b8c58a..19c6aa2 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2503,7 +2503,7 @@ package body Sem_Elab is Collect_Tasks (Declarations (N)); end if; - -- We only perform detailed checks in all tasks are library level + -- We only perform detailed checks in all tasks that are library level -- entities. If the master is a subprogram or task, activation will -- depend on the activation of the master itself. |