This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++/58583] ICE instantiating NSDMIs


On Tue, Jun 16, 2015 at 05:44:49PM +0100, Nathan Sidwell wrote:
> On 06/16/15 03:47, Andreas Schwab wrote:
> > Nathan Sidwell <nathan@acm.org> writes:
> >
> >> 	PR c++/58583
> >> 	* g++.dg/cpp0x/nsdmi-template14.C: New test.
> >
> > spawn -ignore SIGHUP /usr/local/gcc/gcc-20150616/Build/gcc/testsuite/g++2/../../xg++ -B/usr/local/gcc/gcc-20150616/Build/gcc/testsuite/g++2/../../ /usr/local/gcc/gcc-20150616/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C -fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++ -I/usr/local/gcc/gcc-20150616/Build/ia64-suse-linux/libstdc++-v3/include/ia64-suse-linux -I/usr/local/gcc/gcc-20150616/Build/ia64-suse-linux/libstdc++-v3/include -I/usr/local/gcc/gcc-20150616/libstdc++-v3/libsupc++ -I/usr/local/gcc/gcc-20150616/libstdc++-v3/include/backward -I/usr/local/gcc/gcc-20150616/libstdc++-v3/testsuite/util -fmessage-length=0 -std=c++11 -pedantic-errors -Wno-long-long -S -o nsdmi-template14.s.
> > /usr/local/gcc/gcc-20150616/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p'.
> > compiler exited with status 1
> > output is:
> > /usr/local/gcc/gcc-20150616/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p'.
> >
> > FAIL: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 4)
> > FAIL: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 6)
> > PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 14)
> > PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11 (test for excess errors)
> 
> strange.  This is what I got on x86_64-linux (fedora21, FWIW)
> 
> 
> spawn -ignore SIGHUP 
> /home/nathan/egcs/head/x86_64-linux/gcc/testsuite/g++3/../../xg++ 
> -B/home/nathan/egcs/head/x86_64-linux/gcc/testsuite/g++3/../../ 
> /home/nathan/egcs/head/src/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C 
> -fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++ 
> -I/home/nathan/egcs/head/x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu 
> -I/home/nathan/egcs/head/x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/include 
> -I/home/nathan/egcs/head/src/libstdc++-v3/libsupc++ 
> -I/home/nathan/egcs/head/src/libstdc++-v3/include/backward 
> -I/home/nathan/egcs/head/src/libstdc++-v3/testsuite/util -fmessage-length=0 
> -std=c++11 -pedantic-errors -Wno-long-long -S -o nsdmi-template14.s
> 
> PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 4)
> PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 6)
> PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 14)
> PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11 (test for excess errors)
> 
> The missing errors are here:
> 
> template<int> struct A // { dg-error "has been parsed" }
> {
>    int i = (A<0>(), 0); // { dg-error "has been parsed" }
> };
> 
> It's almost as if the initializer isn't being parsed at all. (prior to my patch, 
> it should end up ICEing instantiating DEFARG)

I'm seeing the same issues on aarch64-none-elf and aarch64_be-none-elf
in one of my testing environments, but, interestingly, not on
aarch64-none-linux-gnu or in my other aarch64-none-elf testing
environment (!!). I've pasted both log extracts below (after
stripping the file paths for each build environment, so you can see just
how similar the invocations are!). The PASSing environment does use a
slightly more modern toolchain for building the cross-toolchain (PASSing
environment uses 4.9.2, FAILing environment uses 4.8.1), so that could
be a source of the difference?

Thanks,
James

---
Failing:

spawn .../aarch64-none-elf/obj/gcc2/gcc/testsuite/g++14/../../xg++ -B.../aarch64-none-elf/obj/gcc2/gcc/testsuite/g++14/../../ .../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C -fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++ -I.../aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include/aarch64-none-elf -I.../aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include -I.../gcc/libstdc++-v3/libsupc++ -I.../gcc/libstdc++-v3/include/backward -I.../gcc/libstdc++-v3/testsuite/util -fmessage-length=0 -std=c++11 -pedantic-errors -Wno-long-long -S -mcmodel=small -o nsdmi-template14.s
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p'
compiler exited with status 1
output is:
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p'

FAIL: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 4)
FAIL: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 6)
PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 14)
PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11 (test for excess errors)

Fine:

spawn .../aarch64-none-elf/obj/gcc2/gcc/testsuite/g++14/../../xg++ -B.../aarch64-none-elf/obj/gcc2/gcc/testsuite/g++14/../../ .../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C -fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++ -I.../aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include/aarch64-none-elf -I.../aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include -I.../gcc/libstdc++-v3/libsupc++ -I.../gcc/libstdc++-v3/include/backward -I.../gcc/libstdc++-v3/testsuite/util -fmessage-length=0 -std=c++11 -pedantic-errors -Wno-long-long -S -mcmodel=small -o nsdmi-template14.s

.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:6:20: error: constructor required before non-static data member for 'A<0>::i' has been parsed
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C: In constructor 'constexpr A<0>::A()':
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:4:22: error: constructor required before non-static data member for 'A<0>::i' has been parsed
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C: At global scope:
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:6:20: note: synthesized method 'constexpr A<0>::A()' first required here 
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p'
compiler exited with status 1
output is:
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:6:20: error: constructor required before non-static data member for 'A<0>::i' has been parsed
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C: In constructor 'constexpr A<0>::A()':
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:4:22: error: constructor required before non-static data member for 'A<0>::i' has been parsed
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C: At global scope:
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:6:20: note: synthesized method 'constexpr A<0>::A()' first required here 
.../gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p'

PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 4)
PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 6)
PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11  (test for errors, line 14)
PASS: g++.dg/cpp0x/nsdmi-template14.C  -std=c++11 (test for excess errors)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]