aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 11:35:46 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 11:35:46 +0200
commitbe3416c681291e5a3f6e68d311c958fb05bc7f41 (patch)
tree410efc9899fb1db9b7571359644e18354ea9f5e9 /gcc/ada/sem_ch4.adb
parent003d46d5f302b8b93ac6085e98926c009cc0dec4 (diff)
downloadgcc-be3416c681291e5a3f6e68d311c958fb05bc7f41.zip
gcc-be3416c681291e5a3f6e68d311c958fb05bc7f41.tar.gz
gcc-be3416c681291e5a3f6e68d311c958fb05bc7f41.tar.bz2
[multiple changes]
2017-04-25 Eric Botcazou <ebotcazou@adacore.com> * a-numaux.ads: Fix description of a-numaux-darwin and a-numaux-x86. (Double): Define to Long_Float. * a-numaux-vxworks.ads (Double): Likewise. * a-numaux-darwin.ads (Double): Likewise. * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float. * a-numaux-x86.ads: Fix package description. * a-numaux-x86.adb (Is_Nan): Minor tweak. (Reduce): Adjust and complete description. Call Is_Nan instead of testing manually. Use an integer temporary to hold rounded value. * a-numaux-darwin.adb (Reduce): Likewise. (Is_Nan): New function. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Selected_Component): Additional refinement on analysis of prefix whose type is a current instance of a synchronized type, but where the prefix itself is an entity that is an object. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve the identity of callable entities therein, because they have been properly resolved, and prefixed calls may have been rewritten as normal calls. 2017-04-25 Patrick Bernardi <bernardi@adacore.com> * exp_ch3.adb (Build_Init_Statements): Convert the expression of the pragma/aspect Secondary_Stack_Size to internal type System.Parameters.Size_Type before assigning it to the Secondary_Stack_Size component of the task type's corresponding record. 2017-04-25 Eric Botcazou <ebotcazou@adacore.com> * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc) optimizations when the type is modular and the offsets are equal. 2017-04-25 Eric Botcazou <ebotcazou@adacore.com> * s-osinte-freebsd.ads: Minor comment tweaks 2017-04-25 Javier Miranda <miranda@adacore.com> * urealp.adb (UR_Write): Reverse previous patch adding documentation on why we generate multiplications instead of divisions (needed to avoid expressions whose computation with large numbers may cause division by 0). 2017-04-25 Bob Duff <duff@adacore.com> * erroutc.adb (Set_Specific_Warning_Off, Set_Warnings_Mode_Off): Use the correct source file for Stop. Was using Current_Source_File, which is only valid during parsing. Current_Source_File will have a leftover value from whatever file happened to be parsed last, because of a with_clause or something. 2017-04-25 Bob Duff <duff@adacore.com> * lib.ads, lib.adb (In_Internal_Unit): New functions similar to In_Predefined_Unit, but including GNAT units. * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem, because Should_Ignore_Pragma was not working reliably outside the parser, because Current_Source_File is not valid. * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem. * par-prag.adb: Call Should_Ignore_Pragma_Par. From-SVN: r247162
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index ddb7038..5e66429 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4914,6 +4914,7 @@ package body Sem_Ch4 is
-- expression of the same type, unless the selector designates a
-- public operation (otherwise that would represent an attempt to
-- reach an internal entity of another synchronized object).
+
-- This is legal if prefix is an access to such type and there is
-- a dereference, or is a component with a dereferenced prefix.
-- It is also legal if the prefix is a component of a task type,
@@ -4943,6 +4944,21 @@ package body Sem_Ch4 is
Set_Etype (Sel, Any_Type);
return;
end if;
+
+ -- Another special case: the prefix may denote an object of the type
+ -- (but not a type) in which case this is an external call and the
+ -- operation must be public.
+
+ elsif In_Scope
+ and then Is_Object_Reference (Original_Node (Prefix (N)))
+ and then Is_Private_Op
+ then
+ Error_Msg_NE
+ ("invalid reference to private operation of some object of "
+ & "type &", N, Type_To_Use);
+ Set_Entity (Sel, Any_Id);
+ Set_Etype (Sel, Any_Type);
+ return;
end if;
-- If there is no visible entity with the given name or none of the