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

           Summary: internal error on calling inherited, overloaded and
                    abstract subprograms with string literal
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: demoon...@panathenaia.halfmoon.jp


Created attachment 23560
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23560
minimal bug triggering source code

gcc-4.5.1 and 4.5.2 crash with internal error.

1. declare a type (named A.T) and primitive subprogram (named A.F) having a
String parameter.
2. declare new type (named B.T) derived from A.T, this type has inherited
subprogram B.F from A.F.
3. re-declare B.F as abstract to hide.
4. overload B.F having a Wide_String parameter.
5. call Wide_String version of B.F with string literal.

minimal source:

procedure overload_str is
    package A is
        type T is new Integer;
        procedure F (X : T; Y : String) is null;
    end A;
    package B is
        type T is new A.T;
        procedure F (X : T; Y : Wide_String) is null;
        procedure F (X : T; Y : String) is abstract; -- hide inherited F
    end B;
begin
    B.F (B.T'(0), "ABC"); -- compiler may crash
    B.F (B.T'(0), Wide_String'("ABC")); -- OK
end overload_str;

% gnatmake overload_str
gcc -c overload_str.adb
+===========================GNAT BUG DETECTED==============================+
| 4.5.2 (i686-apple-darwin9) Assert_Failure einfo.adb:1698                 |
| Error detected at overload_str.adb:12:10                                 |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

overload_str.adb

compilation abandoned
gnatmake: "overload_str.adb" compilation error

Reply via email to