From: Arnaud Charlet Date: Mon, 20 Jan 2014 15:57:15 +0000 (+0100) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.9.0~1526 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b465ef6f259f5c29fad23383d9d5d05a3ad2642d;p=thirdparty%2Fgcc.git [multiple changes] 2014-01-20 Robert Dewar * errout.ads, errout.adb: Implement >? >x? >X? sequences in error messages. * sem_ch6.adb (Check_Statement_Sequence): Missing return is an error in GNATprove mode. 2014-01-20 Ed Schonberg * par-ch4.adb (Is_Parameterless_Attribute): The Ada2012 attribute reference 'Old takes no parameters, and thus can appear as a prefix of a slice. 2014-01-20 Eric Botcazou * exp_aggr.adb: Fix minor typos. From-SVN: r206839 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4b1d4c93f4b6..d73b2ee40e67 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2014-01-20 Robert Dewar + + * errout.ads, errout.adb: Implement >? >x? >X? sequences in error + messages. + * sem_ch6.adb (Check_Statement_Sequence): Missing return is an + error in GNATprove mode. + +2014-01-20 Ed Schonberg + + * par-ch4.adb (Is_Parameterless_Attribute): The Ada2012 attribute + reference 'Old takes no parameters, and thus can appear as a + prefix of a slice. + +2014-01-20 Eric Botcazou + + * exp_aggr.adb: Fix minor typos. + 2014-01-20 Ed Schonberg * sem_attr.adb (Analyze_Attribute, case 'Constrained): In an diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 78193ff72803..6679d6a1d282 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -2713,7 +2713,8 @@ package body Errout is P : Natural; -- Current index; procedure Set_Msg_Insertion_Warning; - -- Deal with ? ?? ?x? ?X? insertion sequences + -- Deal with ? ?? ?x? ?X? insertion sequences (also < - -- If tagging of messages is enabled, and this is a warning, - -- then it is treated as being [enabled by default]. + -- Note: the prescan already set Is_Warning_Msg True if and + -- only if Error_Msg_Warn is set to True. If Error_Msg_Warn + -- is False, the call to Set_Msg_Insertion_Warning here does + -- no harm, since Warning_Msg_Char is ignored in that case. - if Error_Msg_Warn - and Warning_Doc_Switch - then - Warning_Msg_Char := '?'; - end if; + Set_Msg_Insertion_Warning; when '|' => null; -- already dealt with diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index 056132924487..4ae39044f1c5 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -64,7 +64,6 @@ package Errout is -- are active (see errout.ads for details). If this switch is False, then -- these sequences are ignored (i.e. simply equivalent to a single ?). The -- -gnatw.d switch sets this flag True, -gnatw.D sets this flag False. - -- Note: always ignored in VMS mode where we do not provide this feature. ----------------------------------- -- Suppression of Error Messages -- @@ -305,8 +304,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. If Error_Msg_Warn is - -- False, then there is no effect. + -- effect is the same as ? described above, and in particular True, Attribute_Img => True, Attribute_Loop_Entry => True, + Attribute_Old => True, Attribute_Stub_Type => True, Attribute_Version => True, Attribute_Type_Key => True, @@ -49,7 +50,8 @@ package body Ch4 is -- string or a type. For those attributes, a left parenthesis after -- the attribute should not be analyzed as the beginning of a parameters -- list because it may denote a slice operation (X'Img (1 .. 2)) or - -- a type conversion (X'Class (Y)). + -- a type conversion (X'Class (Y)). The Ada2012 attribute 'Old is in + -- this category. -- Note: Loop_Entry is in this list because, although it can take an -- optional argument (the loop name), we can't distinguish that at parse diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 9555dd1eab05..3105ac141d34 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -7222,12 +7222,24 @@ package body Sem_Ch6 is if Mode = 'F' then if not Raise_Exception_Call then - Error_Msg_N - ("RETURN statement missing following this statement??!", - Last_Stm); - Error_Msg_N - ("\Program_Error may be raised at run time??!", - Last_Stm); + + -- In GNATprove mode, it is an error to have a missing return + + if GNATprove_Mode then + Error_Msg_N + ("RETURN statement missing following this statement!", + Last_Stm); + + -- Otherwise normal case of warning (RM insists this is legal) + + else + Error_Msg_N + ("RETURN statement missing following this statement??!", + Last_Stm); + Error_Msg_N + ("\Program_Error may be raised at run time??!", + Last_Stm); + end if; end if; -- Note: we set Err even though we have not issued a warning