[Bug c++/12515] New: Use of ?: operator in templated class causes ICE with CVS HEAD

ahu at ds9a dot nl gcc-bugzilla@gcc.gnu.org
Sun Oct 5 12:54:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12515

           Summary: Use of ?: operator in templated class causes ICE with
                    CVS HEAD
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ahu at ds9a dot nl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

Compiling this line with 'g++ crash.cc'

 template<typename A> struct Wuh { void f(int i) { i = i ?: 10; } };

Causes a segmentation violation. Thanks to Falk Hueffner for helping shortening
this to one line.

backtrace of -dH created coredump:

#9  type_dependent_expression_p (expression=0x0) at ../../gcc/cp/pt.c:11574
#10 0x0810cba8 in build_x_conditional_expr (ifexp=0x401e28dc, op1=0x0,
op2=0x401db924) at ../../gcc/cp/typeck.c:4286
#11 0x080f0005 in cp_parser_question_colon_clause (parser=0x401e0980,
logical_or_expr=0x1) at ../../gcc/cp/parser.c:4841
#12 0x080f0087 in cp_parser_assignment_expression (parser=0x401e0980) at
../../gcc/cp/parser.c:4873
#13 0x080f00a6 in cp_parser_assignment_expression (parser=0x401e0980) at
../../gcc/cp/parser.c:4887
#14 0x080f0198 in cp_parser_expression (parser=0x401e0980) at
../../gcc/cp/parser.c:5017
#15 0x080f0568 in cp_parser_expression_statement (parser=0x401e0980,
in_statement_expr_p=false) at ../../gcc/cp/parser.c:5299
#16 0x080f02f0 in cp_parser_statement (parser=0x401e0980,
in_statement_expr_p=false) at ../../gcc/cp/parser.c:5209
#17 0x080f064e in cp_parser_statement_seq_opt (parser=0x401e0980,
in_statement_expr_p=false) at ../../gcc/cp/parser.c:5364
#18 0x080f05d3 in cp_parser_compound_statement (parser=0x401e0980,
in_statement_expr_p=false) at ../../gcc/cp/parser.c:5337
#19 0x080f5bb7 in cp_parser_function_body (parser=0x1) at
../../gcc/cp/parser.c:10849
#20 0x080f5beb in cp_parser_ctor_initializer_opt_and_function_body
(parser=0x401e0980) at ../../gcc/cp/parser.c:10866
#21 0x080f9468 in cp_parser_function_definition_after_declarator
(parser=0x401e0980, inline_p=true)
    at ../../gcc/cp/parser.c:13600
#22 0x080f9a83 in cp_parser_late_parsing_for_member (parser=0x401e0980,
member_function=0x401e2a20)
    at ../../gcc/cp/parser.c:13870
#23 0x080f6475 in cp_parser_class_specifier (parser=0x401e0980) at
../../gcc/cp/parser.c:11326
#24 0x080f3150 in cp_parser_type_specifier (parser=0x401e0980,
flags=CP_PARSER_FLAGS_OPTIONAL, is_friend=false, 
    is_declaration=true, declares_class_or_enum=0xbffff7d4,
is_cv_qualifier=0xbffff7db) at ../../gcc/cp/parser.c:8168
#25 0x080f147c in cp_parser_decl_specifier_seq (parser=0x401e0980,
flags=CP_PARSER_FLAGS_OPTIONAL, attributes=0xbffff814, 
    declares_class_or_enum=0xbffff818) at ../../gcc/cp/parser.c:6382
#26 0x080f97b8 in cp_parser_single_declaration (parser=0x401e0980,
member_p=false, friend_p=0xbffff84b)
    at ../../gcc/cp/parser.c:13723
#27 0x080f96bc in cp_parser_template_declaration_after_export
(parser=0x401e0980, member_p=false) at ../../gcc/cp/parser.c:13660
#28 0x080f1034 in cp_parser_declaration (parser=0x401e0980) at
../../gcc/cp/parser.c:5968
#29 0x080f0e88 in cp_parser_declaration_seq_opt (parser=0x401e0980) at
../../gcc/cp/parser.c:5901



More information about the Gcc-bugs mailing list