Command line: g++ testcase.cpp ------- testcase.cpp ------- struct S; template < typename > struct T { template < typename > template < bool > struct T < S > { void f () { ----------------------------
Tested revisions: trunk r156745 - crash trunk r153685 - crash 4.4 r156256 - crash 4.4 r155365 - crash ==9549== Memcheck, a memory error detector ==9549== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==9549== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==9549== Command: /mnt/svn/gcc-trunk/binary-156745-lto/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus -quiet -D_GNU_SOURCE testcase.cpp -quiet -dumpbase testcase.cpp -mtune=generic -auxbase testcase -o /tmp/cczcVQ4e.s ==9549== testcase.cpp:5:28: error: specialization of 'template<class> struct T' must appear at namespace scope testcase.cpp:5:28: error: template parameters not used in partial specialization: testcase.cpp:5:28: error: '<anonymous>' testcase.cpp:7:15: error: expected '}' at end of input testcase.cpp:7:15: error: expected unqualified-id at end of input testcase.cpp:7:15: error: expected '}' at end of input ==9549== Invalid read of size 2 ==9549== at 0x4F146F: push_template_decl_real (pt.c:4482) ==9549== by 0x4CF96F: start_preparsed_function (decl.c:11778) ==9549== by 0x566DD1: cp_parser_type_specifier (parser.c:19210) ==9549== by 0x572D61: cp_parser_decl_specifier_seq (parser.c:9214) ==9549== by 0x57C5AD: cp_parser_single_declaration (parser.c:18824) ==9549== by 0x57CB72: cp_parser_template_declaration_after_export (parser.c:18735) ==9549== by 0x5824B9: cp_parser_declaration (parser.c:8702) ==9549== by 0x581DC9: cp_parser_declaration_seq_opt (parser.c:8633) ==9549== by 0x5830C4: c_parse_file (parser.c:3090) ==9549== by 0x64ACDE: c_common_parse_file (c-opts.c:1279) ==9549== by 0x8F664B: toplev_main (toplev.c:1053) ==9549== by 0x658EBBC: (below main) (in /lib64/libc-2.11.so) ==9549== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==9549== testcase.cpp:7:15: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. ==9549== -- Summary: ICE: SIGSEGV with invalid C++ code after giving diagnostics Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: zsojka at seznam dot cz http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43076