Bug 11132 - [3.4 Regression] tree-check failure after error for invalid template
Summary: [3.4 Regression] tree-check failure after error for invalid template
Status: RESOLVED DUPLICATE of bug 10793
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P3 minor
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2003-06-09 12:53 UTC by Wolfgang Bangerth
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-07-17 01:50:42


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-06-09 12:53:57 UTC
Another case of a forgotten check for error_mark, entirely unimportant and
maybe even a duplicate of all the other cases we have:
--------------------------------
struct X {};

template <int dim>
struct Y<2, dim> : public X {};
--------------------------------

g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc
y.cc:4: error: wrong number of template arguments (2, should be 1)
y.cc:4: error: provided for `template<int dim> struct Y'
y.cc:4: internal compiler error: tree check: expected class 't', have 'x' (
   error_mark) in xref_basetypes, at cp/decl.c:12801
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2003-06-09 13:10:44 UTC
Confirmed on the mainline (20030609):

#5  0x080819f1 in xref_basetypes (ref=0x4004d54c, base_list=0x400ad2e4) at /home/
gates/pinskia/src/gnu/gcc/src/gcc/cp/decl.c:12961
#6  0x08101b21 in cp_parser_class_head (parser=0x400aa480, 
nested_name_specifier_p=0xbffec1eb) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/
parser.c:11843
#7  0x08101159 in cp_parser_class_specifier (parser=0x400aa480) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/cp/parser.c:11431
#8  0x080fe07b in cp_parser_type_specifier (parser=0x400aa480, flags=
CP_PARSER_FLAGS_OPTIONAL, is_friend=false, is_declaration=true, 
declares_class_or_enum=0xbffec26e, is_cv_qualifier=0xbffec26f) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/cp/parser.c:8472
#9  0x080fc5dd in cp_parser_decl_specifier_seq (parser=0x400aa480, flags=
CP_PARSER_FLAGS_OPTIONAL, attributes=0xbffec2b0, declares_class_or_enum=
0xbffec2b7) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:6802
#10 0x0810080f in cp_parser_function_definition (parser=0x400aa480, friend_p=
0xbffec32b) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:10958
#11 0x0810487f in cp_parser_single_declaration (parser=0x400aa480, member_p=
false, friend_p=0xbffec32b) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:14020
#12 0x0810462a in cp_parser_template_declaration_after_export (parser=0x400aa480, 
member_p=false) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:13906
#13 0x080fc152 in cp_parser_declaration (parser=0x400aa480) at /home/gates/pinskia/
src/gnu/gcc/src/gcc/cp/parser.c:6404
#14 0x080fbf68 in cp_parser_declaration_seq_opt (parser=0x400aa480) at /home/
gates/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:6337
#15 0x080f7992 in cp_parser_translation_unit (parser=0x400aa480) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/cp/parser.c:2256
#16 0x081055c2 in yyparse () at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/
parser.c:14671
#17 0x0817db26 in c_common_parse_file (set_yydebug=131) at /home/gates/pinskia/
src/gnu/gcc/src/gcc/c-opts.c:1198
#18 0x083b163a in compile_file () at /home/gates/pinskia/src/gnu/gcc/src/gcc/
toplev.c:2214
#19 0x083b7767 in do_compile () at /home/gates/pinskia/src/gnu/gcc/src/gcc/
toplev.c:5742
#20 0x083b77d9 in toplev_main (argc=131, argv=0x0) at /home/gates/pinskia/src/gnu/
gcc/src/gcc/toplev.c:5771
#21 0x08181a8b in main (argc=131, argv=0x83) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/main.c:37
Comment 2 Andrew Pinski 2003-06-14 23:55:36 UTC
It did not ICE in 3.2.3 or 3.3.1 (20030526) so this is a regression.
Comment 3 Volker Reichelt 2003-06-30 23:26:33 UTC
Maybe related to PR 10793.
Comment 4 Kriang Lerdsuwanakij 2003-07-22 12:35:11 UTC

*** This bug has been marked as a duplicate of 10793 ***