public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type
@ 2011-03-13 21:17 redi at gcc dot gnu.org
  2011-04-08  9:16 ` [Bug c++/48106] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-13 21:17 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/48106] [C++0x] ICE with scoped enum with fixed underlying type
  2011-03-13 21:17 [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type redi at gcc dot gnu.org
@ 2011-04-08  9:16 ` redi at gcc dot gnu.org
  2011-05-22 20:04 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-08  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-08 09:16:10 UTC ---
CC Jason


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/48106] [C++0x] ICE with scoped enum with fixed underlying type
  2011-03-13 21:17 [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type redi at gcc dot gnu.org
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-22 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.05.22 19:22:44
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/48106] [C++0x] ICE with scoped enum with fixed underlying type
  2011-03-13 21:17 [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type redi at gcc dot gnu.org
  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
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-23 23:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-23 22:55:51 UTC ---
Author: jason
Date: Mon May 23 22:55:46 2011
New Revision: 174091

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174091
Log:
    PR c++/48106
    * c-common.c (c_common_get_narrower): New.
    (shorten_binary_op, shorten_compare, warn_for_sign_compare): Use it.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/enum14.C
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/48106] [C++0x] ICE with scoped enum with fixed underlying type
  2011-03-13 21:17 [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-25  2:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 01:20:58 UTC ---
Fixed for 4.7.0.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/48106] [C++0x] ICE with scoped enum with fixed underlying type
  2011-03-13 21:17 [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-05-25  2:17 ` jason at gcc dot gnu.org
@ 2011-05-25  9:11 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-05-25  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-25 08:18:15 UTC ---
thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-25  8:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-13 21:17 [Bug c++/48106] New: [C++0x] ICE with scoped enum with fixed underlying type redi at gcc dot gnu.org
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

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).