https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81328
Bug ID: 81328 Summary: Wrong order of error messages Product: gcc Version: 7.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: porton at narod dot ru Target Milestone: --- Created attachment 41688 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41688&action=edit A source with a deliberate error GNAT provides an error list for my erroneous input in wrong order. I sent a minimized code where this is not a problem, but I got this GNAT behavior in real code, what lead me to try to first fix the first error (which in reality was caused by the second error), but it was unexpected that to fix the first error I first need to fix the second error. The output order of compilation errors should be such that the programmer would be able to fix the errors in the order of compiler output, rather than to make the programmer to guess that he needs first look into the next error. Here is compilation of my erroneous source (the error is missing `with Auxiliary;` in www.ads file): $ gnatgcc -c www.adb www.adb:6:14: "From_Handle" is not visible www.adb:6:14: non-visible declaration at limited_handled_record.ads:7 www.ads:6:61: "Auxiliary" is undefined www.ads:6:70: instantiation abandoned www.ads:8:28: "WWW_Handled_Record" is undefined (more references follow) To make From_Handle visible, I need first note that the problem is caused by Auxiliary being undefined. The message that it is not visible is confusing, because it is not just not visible but in reality undefined. $ gnatgcc -v Using built-in specs. COLLECT_GCC=gnatgcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 7.1.0-7' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.1.0 (Debian 7.1.0-7)