$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)


$ cat /etc/redhat-release
CentOS release 5.3 (Final)


$ gnatmake -gnat05  bug_main.adb
gcc -c -gnat05 bug_main.adb
+===========================GNAT BUG DETECTED==============================+
| 4.1.2 20080704 (Red Hat 4.1.2-46) (i386-redhat-linux-gnu) Assert_Failure
nlists.adb:853|
| Error detected at bug_pkg.ads:4:1                                        |
| 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.

bug_main.adb
bug_pkg.ads

compilation abandoned
gnatmake: "bug_main.adb" compilation error

Source files:

with Ada.Finalization;
with Ada.Streams;

package Bug_Pkg is

   type Objects is private;

   procedure My_Write (Stream : not null access
Ada.Streams.Root_Stream_Type'Class;
                       Item   : in Objects);
   for Objects'Write use My_Write;

private

   type Objects is new Ada.Finalization.Controlled with record
      null;
   end record;

end Bug_Pkg;
package body Bug_Pkg is

   procedure My_Write (Stream : not null access
Ada.Streams.Root_Stream_Type'Class;
                       Item   : in Objects) is
   begin
      null;
   end My_Write;

end Bug_Pkg;
with Bug_Pkg;

procedure Bug_Main is
begin
   null;
end Bug_Main;


Expected behavior:
$ gnatmake -gnat05    bug_main.adb
gcc -c -gnat05 bug_main.adb
gcc -c -gnat05 bug_pkg.adb
gnatbind -x bug_main.ali
gnatlink bug_main.ali

Actual behavior: See above.


-- 
           Summary: Ada attribute definition clause for controlled type
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot starritt at synchrotron dot org dot au


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

Reply via email to