This is the mail archive of the gcc-bugs@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]

[Bug ada/39793] New: gnatxref generates incomplete output for overloaded operator


This bug report only concerns gnatxref not the gnat compiler.

Given the following :

package bug_op is
 type Vector is array (1 .. 1) of Integer;
 function "&"(A, B : Vector) return Vector;
end bug_op;

with Ada.Integer_Text_Io; use Ada.Integer_Text_Io;
package body bug_op is
  V : Vector;
function "&"(A, B : Vector) return Vector is
begin
  return Vector'(1 => 42);
end "&";

begin
  V := Vector'(1 => 1) & Vector'(1 => 1);
  Put(V(1), 0);
end bug_op;

the .ali files contains the line:

4V10*"&"{3A6}<3p6> 4>14 4>17 14|4b10 7l5 7t8 10r24

which is correct, but gnat xref only outputs:
"&"                                              function
  Decl:  bug_op.ads             4:10

(i.e. it is missing the body and reference)

if the "&" is changed to a "+" in the original code the .ali file contains:

4V10*"+"{3A6} 4>14 4>17 14|4b10 7l5 7t8 10r24

and gnatxref gets it and outputs the correct references:

"+"                                              function
  Decl:  bug_op.ads             4:10
  Body:  bug_op.adb             4:10
  Ref:   bug_op.adb            10:24


Note that gnatxref shipped with gnat 3.4.2 behaves properly in both
circumstances. 

Sincerely,
David
http://www.midoan.com


-- 
           Summary: gnatxref generates incomplete output for overloaded
                    operator
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: david at midoan dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39793


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