This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++/58583] ICE instantiating NSDMIs
- From: Nathan Sidwell <nathan at acm dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 Jun 2015 12:44:49 -0400
- Subject: Re: [C++/58583] ICE instantiating NSDMIs
- Authentication-results: sourceware.org; auth=none
- References: <557384CB dot 1020301 at acm dot org> <5575D517 dot 1030708 at redhat dot com> <5576EE23 dot 6030806 at acm dot org> <mvmk2v4858a dot fsf at hawking dot suse dot de>
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)
nathan