On 06/16/15 03:47, Andreas Schwab wrote:
Nathan Sidwell <nat...@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