This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Operator name returned by GNAT.Source_Info.Enclosing_Entity


The string returned by GNAT.Source_Info.Enclosing_Entity did not include
names of operators (e.g. "**").

The following program:

     1. with Text_IO; use Text_IO;
     2. with GNAT.Source_Info; use GNAT.Source_Info;
     3. procedure BadEE is
     4.    type R is new Boolean;
     5.    RV : R := True;
     6.
     7.    function "**" (X, Y : R) return String is
     8.    begin
     9.       return Enclosing_Entity;
    10.    end;
    11. begin
    12.    Put_Line (RV ** RV);
    13. end BadEE;

must output the string:

BadEE."**"

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-10-10  Robert Dewar  <dewar@adacore.com>

	* exp_intr.adb (Write_Entity_Name): Moved to outer level
	(Write_Entity_Name): Properly handle operator names
	(Expand_Source_Info): New procedure.
	* exp_intr.ads (Add_Source_Info): New procedure.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]