public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/48002] New: internal error on calling inherited, overloaded and abstract subprograms with string literal
@ 2011-03-06 12:03 demoonlit at panathenaia dot halfmoon.jp
  2014-11-10 12:42 ` [Bug ada/48002] " fxcoudert at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: demoonlit at panathenaia dot halfmoon.jp @ 2011-03-06 12:03 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: demoonlit@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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-01 23:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-06 12:03 [Bug ada/48002] New: internal error on calling inherited, overloaded and abstract subprograms with string literal demoonlit at panathenaia dot halfmoon.jp
2014-11-10 12:42 ` [Bug ada/48002] " fxcoudert at gcc dot gnu.org
2014-11-10 14:18 ` charlet at gcc dot gnu.org
2015-04-22 11:57 ` jakub at gcc dot gnu.org
2015-07-16  9:11 ` rguenth at gcc dot gnu.org
2015-07-18 10:29 ` demoonlit at panathenaia dot halfmoon.jp
2015-09-01 23:34 ` demoonlit at panathenaia dot halfmoon.jp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).