https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62236
Bug ID: 62236 Summary: <built-in>: error: aggregate value used where an integer was expected Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: porton at narod dot ru Created attachment 33382 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33382&action=edit A program which doesn't compile The below program (its copy is also attached) does not compile. We suspect a compiler bug. $ gnatgcc -v Using built-in specs. COLLECT_GCC=gnatgcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-linux-gnu/4.9/lto-wrapper Target: i586-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.1-4' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --with-arch-32=i586 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i586-linux-gnu --host=i586-linux-gnu --target=i586-linux-gnu Thread model: posix gcc version 4.9.1 (Debian 4.9.1-4) $ gnatgcc -c -g -O2 -gnat2012 -g -O0 -gnato -fstack-check -gnatVa special_test.adb <built-in>: In function ‘Special_Test’: <built-in>: error: aggregate value used where an integer was expected with Ada.Iterator_Interfaces; procedure Special_Test is type My_Description_Cursor is null record; function Has_Element (Position: My_Description_Cursor) return Boolean is (False); package My_Description_Iterators is new Ada.Iterator_Interfaces(My_Description_Cursor, Has_Element); type My_Description_Iterator is new My_Description_Iterators.Forward_Iterator with null record; overriding function First (Object: My_Description_Iterator) return My_Description_Cursor is (null record); overriding function Next (Object: My_Description_Iterator; Position: My_Description_Cursor) return My_Description_Cursor is (null record); My_Iterator: My_Description_Iterator; begin for C in My_Iterator loop null; end loop; end;