[Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 13 21:17:00 GMT 2011


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

           Summary: [C++0x] ICE with scoped enum with fixed underlying
                    type
           Product: gcc
           Version: 4.4.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


enum class E : char
{
  e
};

bool operator&(E e, char m)
{
  return static_cast<int>(e) & m;
}


Program received signal SIGSEGV, Segmentation fault.
c_common_signed_or_unsigned_type (unsignedp=0, type=0x0) at
/home/redi/src/gcc/gcc-4.x/gcc/c-family/c-common.c:3010
3010      type1 = TYPE_MAIN_VARIANT (type);
(gdb) p type
$1 = (union tree_node *) 0x0
(gdb) bt 10
#0  c_common_signed_or_unsigned_type (unsignedp=0, type=0x0) at
/home/redi/src/gcc/gcc-4.x/gcc/c-family/c-common.c:3010
#1  0x00000000006460ac in shorten_binary_op (result_type=0x7ffff203c498,
op0=<value optimized out>, op1=0x7ffff2029930, bitwise=1 '\001')
    at /home/redi/src/gcc/gcc-4.x/gcc/c-family/c-common.c:1840
#2  0x00000000005adc2c in cp_build_binary_op (location=1016, code=BIT_AND_EXPR,
orig_op0=0x7ffff2029900, orig_op1=0x7ffff202f990, complain=3)
    at /home/redi/src/gcc/gcc-4.x/gcc/cp/typeck.c:4374
#3  0x00000000004bd546 in build_new_op (code=BIT_AND_EXPR, flags=3,
arg1=0x7ffff2029900, arg2=0x7ffff202f990, arg3=0x0, overloaded_p=0x7fffffffd6af
"", 
    complain=3) at /home/redi/src/gcc/gcc-4.x/gcc/cp/call.c:4931
#4  0x00000000005a03b5 in build_x_binary_op (code=BIT_AND_EXPR,
arg1=0x7ffff2029900, arg1_code=ERROR_MARK, arg2=0x7ffff202f990,
arg2_code=ERROR_MARK, 
    overloaded_p=<value optimized out>, complain=3) at
/home/redi/src/gcc/gcc-4.x/gcc/cp/typeck.c:3508
#5  0x0000000000585e9d in cp_parser_binary_expression (parser=0x7ffff1f4e268,
cast_p=<value optimized out>, no_toplevel_fold_p=0 '\000', 
    prec=PREC_NOT_OPERATOR, pidk=<value optimized out>) at
/home/redi/src/gcc/gcc-4.x/gcc/cp/parser.c:6939
#6  0x00000000005861b3 in cp_parser_assignment_expression
(parser=0x7ffff1f4e268, cast_p=0 '\000', pidk=0x0)
    at /home/redi/src/gcc/gcc-4.x/gcc/cp/parser.c:7044
#7  0x000000000058654a in cp_parser_expression (parser=0x7ffff1f4e268,
cast_p=<value optimized out>, pidk=0x0)
    at /home/redi/src/gcc/gcc-4.x/gcc/cp/parser.c:7190
#8  0x00000000005791de in cp_parser_jump_statement (parser=0x7ffff1f4e268,
in_statement_expr=0x0, in_compound=1 '\001', if_p=<value optimized out>)
    at /home/redi/src/gcc/gcc-4.x/gcc/cp/parser.c:9196
#9  cp_parser_statement (parser=0x7ffff1f4e268, in_statement_expr=0x0,
in_compound=1 '\001', if_p=<value optimized out>)
    at /home/redi/src/gcc/gcc-4.x/gcc/cp/parser.c:8097
(More stack frames follow...)


The stack trace is from 4.6.0 but 4.4 and 4.5 fail in the same way



More information about the Gcc-bugs mailing list