New: ICE using operator int in invalid class hierarchy
5 answers - 570 bytes -
The following invalid code snippet triggers a segfault since GCC 3.4.0: struct A { operator int(); }; struct B : virtual A, A<0{}; int foo(B &b) { return b; } bug.cc:6: error: expected template-name before '<' token bug.cc:6: error: expected `{' before '<' token bug.cc:6: error: expected unqualified-id before '<' token bug.cc: In function 'int foo(B&)': bug.cc:10: internal compiler error: Segmentation fault Please submit a full bug report, [etc.]
No.1 | | 131 bytes | |
-- reichelt at gcc dot gnu dot org changed: What |Removed |Added Target Milestone| |4.0.4
No.2 | | 1271 bytes | |
Comment #1 from pinskia at gcc dot gnu dot org 2006-09-12 05:46 Backtrace: #0 0x08106fb5 in build_vfield_ref (datum=0xb7d6d760, type=0xb7da16d4) at //gcc/cp/class.c:554 #1 0x081063b3 in build_base_path (code=PLUS_EXPR, expr=0xb7d6d720, binfo=0xb7ff5800, nonnull=1) at //gcc/cp/class.c:355 #2 0x0805af73 in build_over_call (cand=0x951ca24, flags=3) at //gcc/cp/call.c:4821 #3 0x08058bb7 in convert_like_real (convs=0x951ca80, expr=0xb7d6d6e0, fn=0x0, argnum=0, inner=0, issue_conversion_warnings=1 '\001', c_cast_p=0 '\0') at //gcc/cp/call.c:4288 #4 0x08061984 in perform_implicit_conversion (type=0xb7cfe284, expr=0xb7d6d6e0) at //gcc/cp/call.c:6431 #5 0x081a1dcc in convert_for_assignment (type=0xb7cfe284, rhs=0xb7d6d6e0, errtype=0x8985c65 "return", fndecl=0x0, parmnum=0) at //gcc/cp/typeck.c:6234 #6 0x081a228f in convert_for_initialization (exp=0x0, type=0xb7cfe284, rhs=0xb7d6d6e0, flags=11, errtype=0x8985c65 "return", fndecl=0x0, parmnum=0) at //gcc/cp/typeck.c:6323 #7 0x081a3660 in check_return_expr (retval=0xb7d6d6e0, no_warning=0xbfce47eb "") at //gcc/cp/typeck.c:6591 #8 0x081d0668 in finish_return_stmt (expr=0xb7d6d6e0) at //gcc/cp/semantics.c:753
No.3 | | 122 bytes | |
-- mmitchel at gcc dot gnu dot org changed: What |Removed |Added Priority|P3 |P4
No.4 | | 291 bytes | |
-- lmillward at gcc dot gnu dot org changed: What |Removed |Added AssignedTo|unassigned at gcc dot gnu |lmillward at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-09-12 05:46:36 |2006-10-18 19:21:53 date| |
No.5 | | 203 bytes | |
Comment #2 from patchapp at dberlin dot org 2006-10-18 19:36 Subject: Bug number PR c++/29022 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is
Re: New: ICE using operator int in invalid class hierarchy