[Ada] Overriding errors on renamings and instances overriding predefined operators
authorGary Dismukes <dismukes@adacore.com>
Mon, 12 Apr 2021 21:20:33 +0000 (17:20 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 29 Jun 2021 14:23:47 +0000 (14:23 +0000)
commit4c07e6d67921bb0793890550094d464153e479eb
tree586196fcbe6843fecb25faed38f8ef48d7d17173
parent430d508058bfe1c88c582a2256ff4dc3854c369d
[Ada] Overriding errors on renamings and instances overriding predefined operators

gcc/ada/

* sem_ch6.ads (Can_Override_Operator): Function declaration
moved from package body to package spec.
* sem_ch6.adb (Check_Overriding_Indicator): Now use test of
whether the subprogram's Chars is an operator name, to handle
cases of function instances whose entity is
N_Defining_Identifier rather than N_Defining_Operator_Symbol.
(Can_Override_Operator): Function declaration moved to package
spec.  Now use test of whether the subprogram's Chars is an
operator name, to handle cases of function instances whose
entity is N_Defining_Identifier rather than
N_Defining_Operator_Symbol.
* sem_ch8.adb (Analyze_Renamed_Subprogram): Check for
possibility of an overridden predefined operator, and suppress
the "not overriding" message in that case.
gcc/ada/sem_ch6.adb
gcc/ada/sem_ch6.ads
gcc/ada/sem_ch8.adb