------- Comment #7 from steven at gcc dot gnu dot org  2005-12-18 16:04 -------
comment #6 says "invalid code".  So is this an ICE on valid, or _invalid_ code?

Anyway,

Starting program: /abuild/stevenb/build/gcc/cc1plus t.C
 A<T>::A()
Breakpoint 4, expand_member_init (name=0x401c9958) at init.c:950
950       if (!current_class_ref)
(gdb) cont
Continuing.
 A<T>::A() [with T = int*]
Breakpoint 4, expand_member_init (name=0x40153c38) at init.c:950
950       if (!current_class_ref)
(gdb) next
953       if (!name)
(gdb) p debug_generic_expr(name)
intD.2 *
$9 = void
(gdb) next
973       else if (TYPE_P (name))
(gdb)
975           basetype = TYPE_MAIN_VARIANT (name);
(gdb)
976           name = TYPE_NAME (name);
(gdb)
983       if (basetype)
(gdb) p debug_generic_expr(name)

$10 = void
(gdb) p debug_generic_expr(basetype)
intD.2 *
$11 = void
(gdb) 

So we have nullified name.  Then we go on to the error message without a name:

(gdb) b init.c:1025
Breakpoint 5 at 0x815c5fb: file init.c, line 1025.
(gdb) cont
Continuing.

Breakpoint 5, expand_member_init (name=0x0) at init.c:1025
1025                error ("type %qD is not a direct base of %qT",
(gdb) l
1020            {
1021              if (CLASSTYPE_VBASECLASSES (current_class_type))
1022                error ("type %qD is not a direct or virtual base of %qT",
1023                       name, current_class_type);
1024              else
1025                error ("type %qD is not a direct base of %qT",
1026                       name, current_class_type);
1027              return NULL_TREE;
1028            }
1029
(gdb) p name
$12 = 0x0
(gdb) 

Obviously we ICE when we try to print the NULL name.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code


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

Reply via email to