diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-07 11:13:15 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-07 11:13:15 +0000 |
commit | 56e11f1214108d81c908076214fe6429f345b83d (patch) | |
tree | 7e29f04a9f5e7c2488ad2c344c01a8bcdefe2514 /gcc/ada/sem_attr.adb | |
parent | c06a893fd03d290ae7c72bbb8a7160db05a83889 (diff) | |
download | gcc-56e11f1214108d81c908076214fe6429f345b83d.tar.gz |
2015-01-07 Bob Duff <duff@adacore.com>
* usage.adb (Usage): Document -gnatw.f switch.
2015-01-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb: Code clean up and minor reformatting.
2015-01-07 Robert Dewar <dewar@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): Add guard for
Raise_Accessibility_Error call.
* s-valllu.ads (Scan_Raw_Long_Long_Unsigned): Add documentation
on handling of invalid digits in based constants.
* s-fatgen.ads: Minor reformatting.
* sem_attr.adb (Analyze_Attribute, case Unrestricted_Access):
Avoid noting bogus modification for Valid test.
* snames.ads-tmpl (Name_Attr_Long_Float): New Name.
* einfo.ads: Minor reformatting.
* sem_warn.adb: Minor comment clarification.
* sem_ch12.adb: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219296 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 7b6ae24f831..8eb85dc5e01 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -9853,8 +9853,38 @@ package body Sem_Attr is Access_Attribute : begin + -- Note possible modification if we have a variable + if Is_Variable (P) then - Note_Possible_Modification (P, Sure => False); + declare + PN : constant Node_Id := Parent (N); + Nm : Node_Id; + + Note : Boolean := True; + -- Skip this for the case of Unrestricted_Access occuring in + -- the context of a Valid check, since this otherwise leads + -- to a missed warning (the Valid check does not really + -- modify!) If this case, Note will be reset to False. + + begin + if Attr_Id = Attribute_Unrestricted_Access + and then Nkind (PN) = N_Function_Call + then + Nm := Name (PN); + + if Nkind (Nm) = N_Expanded_Name + and then Chars (Nm) = Name_Valid + and then Nkind (Prefix (Nm)) = N_Identifier + and then Chars (Prefix (Nm)) = Name_Attr_Long_Float + then + Note := False; + end if; + end if; + + if Note then + Note_Possible_Modification (P, Sure => False); + end if; + end; end if; -- The following comes from a query concerning improper use of |