public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type
Date: Sun, 13 Mar 2011 21:17:00 -0000	[thread overview]
Message-ID: <bug-48106-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2011-03-13 21:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-13 21:17 redi at gcc dot gnu.org [this message]
2011-04-08  9:16 ` [Bug c++/48106] " redi at gcc dot gnu.org
2011-05-22 20:04 ` jason at gcc dot gnu.org
2011-05-23 23:56 ` jason at gcc dot gnu.org
2011-05-25  2:17 ` jason at gcc dot gnu.org
2011-05-25  9:11 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-48106-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).