aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 11:06:47 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 11:06:47 +0200
commit11775988d5f6db984fb902b7447a5b2817b555b1 (patch)
tree9203c93f7366264fb3b03a3a500654d527e52570 /gcc/ada/lib-xref.adb
parentf32eb59134d6d55d50cbce3e1900e2dafdfac8aa (diff)
downloadgcc-11775988d5f6db984fb902b7447a5b2817b555b1.zip
gcc-11775988d5f6db984fb902b7447a5b2817b555b1.tar.gz
gcc-11775988d5f6db984fb902b7447a5b2817b555b1.tar.bz2
[multiple changes]
2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Generate_Range_Check): Revert previous change. 2017-04-27 Gary Dismukes <dismukes@adacore.com> * sem_util.adb: Minor reformatting/rewording. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * lib-xref.adb (Generate_Reference): The use of attribute 'Result is not considered a violation of pragma Unreferenced. 2017-04-27 Justin Squirek <squirek@adacore.com> * cstand.adb (Create_Standard): Correctly set Directly_Designated_Type for Any_Access. * sem_type.adb (Covers): Minor grammar fixes. 2017-04-27 Bob Duff <duff@adacore.com> * sem_attr.adb: Minor cleanup. 2017-04-27 Claire Dross <dross@adacore.com> * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New private child of Ada.Containers used to implement all functional containers. * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New child of Ada.Containers. It provides functional indefinite unbounded maps which can be used as high level models for specification of data structures. * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New child of Ada.Containers. It provides functional indefinite unbounded sets which can be used as high level models for specification of data structures. * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New child of Ada.Containers. It provides functional indefinite unbounded vectors which can be used as high level models for specification of data structures. * Makefile.rtl: Add new packages. * impunit.adb: Add new packages. From-SVN: r247296
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 4d9fe69..bcb1b6c 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2016, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2017, 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- --
@@ -848,8 +848,8 @@ package body Lib.Xref is
if Has_Unreferenced (E)
and then In_Same_Extended_Unit (E, N)
then
- -- A reference as a named parameter in a call does not count
- -- as a violation of pragma Unreferenced for this purpose...
+ -- A reference as a named parameter in a call does not count as a
+ -- violation of pragma Unreferenced for this purpose...
if Nkind (N) = N_Identifier
and then Nkind (Parent (N)) = N_Parameter_Association
@@ -857,12 +857,22 @@ package body Lib.Xref is
then
null;
- -- ... Neither does a reference to a variable on the left side
- -- of an assignment.
+ -- ... Neither does a reference to a variable on the left side of
+ -- an assignment.
elsif Is_On_LHS (N) then
null;
+ -- Do not consider F'Result as a violation of pragma Unreferenced
+ -- since the attribute acts as an anonymous alias of the function
+ -- result and not as a real reference to the function.
+
+ elsif Ekind_In (E, E_Function, E_Generic_Function)
+ and then Is_Entity_Name (N)
+ and then Is_Attribute_Result (Parent (N))
+ then
+ null;
+
-- No warning if the reference is in a call that does not come
-- from source (e.g. a call to a controlled type primitive).