aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_disp.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-04-25 12:28:45 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-25 12:28:45 +0200
commit0812b84e77d5b5d187ea4c75841e4569f016612f (patch)
tree1709a49cd2beccc5cb64451b8470a07e5801ea9d /gcc/ada/sem_disp.adb
parent1355d3738f0cabb2029899b905305e728d75674a (diff)
downloadgcc-0812b84e77d5b5d187ea4c75841e4569f016612f.zip
gcc-0812b84e77d5b5d187ea4c75841e4569f016612f.tar.gz
gcc-0812b84e77d5b5d187ea4c75841e4569f016612f.tar.bz2
[multiple changes]
2013-04-25 Robert Dewar <dewar@adacore.com> * debug.adb: Remove d.X and d.Y entries and documentation. * exp_ch4.adb (Expand_N_If_Expression): Remove special code used if expression with actions not available (now always available). (Expand_Short_Circuit_Operator): Same change. * gnat1drv.adb (Adjust_Global_Switches) Remove setting Use_Expression_With_Actions flag, since this is now obsolete. * opt.ads (Use_Expression_Actions): Removed (always True now). * sinfo.ads: Minor comment updates. 2013-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Check_Generic_Actuals): If an actual is an array subtype whose base type is currently private, install full view when compiling instance body. 2013-04-25 Ed Schonberg <schonberg@adacore.com> * sem_disp.adb (Check_Dispatching_Operation): Refine checks for AI05-0125: the check for a hidden primitive that may be overridden by the new declaration is only performed if the declaration comes from source, and it must carry an explicit overriding indicator. 2013-04-25 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Abstract_States): The attribute now applies to generic packages. * sem_ch3.adb (Analyze_Object_Declaration): Check whether an object declaration introduces an illegal hidden state. * sem_prag.adb (Analyze_Abstract_State): Check whether a state declaration introduces an illegal hidden state. * sem_util.ads, sem_util.adb (Check_No_Hidden_State): New routine. 2013-04-25 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Is_Build_In_Place_Function_Call): The call may be to a protected function, in which case the name in the call is a selected component. 2013-04-25 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch4.adb (Analyze_Quantified_Expression): Warn on a suspicious use of quantifier "some" when "all" was meant. (No_Else_Or_Trivial_True): New routine. From-SVN: r198287
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-rw-r--r--gcc/ada/sem_disp.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index e60574a..8d779b2 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -1196,12 +1196,25 @@ package body Sem_Disp is
Ovr_Subp := Old_Subp;
-- [Ada 2012:AI-0125]: Search for inherited hidden primitive that may be
- -- overridden by Subp
+ -- overridden by Subp. This only applies to source subprograms, and
+ -- their declaration must carry an explicit overriding indicator.
if No (Ovr_Subp)
and then Ada_Version >= Ada_2012
+ and then Comes_From_Source (Subp)
+ and then
+ Nkind (Unit_Declaration_Node (Subp)) = N_Subprogram_Declaration
then
Ovr_Subp := Find_Hidden_Overridden_Primitive (Subp);
+
+ -- Verify that the proper overriding indicator has been supplied.
+
+ if Present (Ovr_Subp)
+ and then
+ not Must_Override (Specification (Unit_Declaration_Node (Subp)))
+ then
+ Error_Msg_NE ("missing overriding indicator for&", Subp, Subp);
+ end if;
end if;
-- Now it should be a correct primitive operation, put it in the list