The change reverts the test deciding whether an initialization procedure
can be inherited from parent to derived type to the original
implementation, which allowed inheriting a null procedure.
This prevents the creation of another null initialization procedure for
the derived type, which in turn can avoid an artificial overloading
which can wreak havoc in the analysis of private declarations of a
package.
2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_ch3.adb (Build_Record_Init_Proc): Inherit an
initialization procedure if it is present, even if it is null.
gcc/testsuite/
* gnat.dg/overload2.adb, gnat.dg/overload2_p.adb,
gnat.dg/overload2_p.ads, gnat.dg/overload2_q.adb,
gnat.dg/overload2_q.ads: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266753
138bc75d-0d04-0410-961f-
82ee72b054a4
+2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_ch3.adb (Build_Record_Init_Proc): Inherit an
+ initialization procedure if it is present, even if it is null.
+
2018-12-03 Patrick Bernardi <bernardi@adacore.com>
* libgnarl/s-taskin.ads (ATC_Level_Base): Redefine to span from
and then not Is_Unchecked_Union (Rec_Type)
and then not Has_New_Non_Standard_Rep (Rec_Type)
and then not Parent_Subtype_Renaming_Discrims
- and then Has_Non_Null_Base_Init_Proc (Etype (Rec_Type))
+ and then Present (Base_Init_Proc (Etype (Rec_Type)))
then
Copy_TSS (Base_Init_Proc (Etype (Rec_Type)), Rec_Type);
+2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/overload2.adb, gnat.dg/overload2_p.adb,
+ gnat.dg/overload2_p.ads, gnat.dg/overload2_q.adb,
+ gnat.dg/overload2_q.ads: New testcase.
+
2018-12-03 Fritz Reese <fritzoreese@gmail.com>
Mark Eggleston <mark.eggleston@codethink.co.uk>
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnat95" }
+
+with Overload2_P; use Overload2_P;
+with text_io; use text_io;
+procedure overload2 is
+ this, that: t;
+ yes : boolean := this /= that;
+begin
+ if not yes then
+ put_line ("FAILED");
+ end if;
+end;
--- /dev/null
+-- { dg-options "-gnat95 -gnatws" }
+
+package body overload2_p is
+ function "=" (this, that: t) return boolean is begin return True; end;
+ this, that : t;
+end;
--- /dev/null
+with overload2_q;
+package overload2_p is
+ type t is new overload2_q.t;
+private
+ function "=" (this, that: t) return boolean;
+end;
--- /dev/null
+-- { dg-options "-gnat95" }
+
+package body overload2_q is
+ function "=" (this, that: t) return boolean is begin return False; end;
+end;
--- /dev/null
+package overload2_q is
+ type t is null record;
+ function "=" (this, that: t) return boolean;
+end;