Hi.
On 08/22/2012 04:14 PM, Paolo Carlini wrote:
Hi,
On 08/22/2012 04:09 PM, Jason Merrill wrote:
On 08/22/2012 08:43 AM, Paolo Carlini wrote:
yesterday I had a look to this old PR and noticed that we are almost
doing already the right thing for the original testcase: we are for
classes, but we ICE (something recent) for enums. The latter issue
seems
easy to fix: handle specially enums at the beginning of
supplement_binding_1 only when the comment says, that is in templates
(otherwise we hit an assert in dependent_type_p).
Which assert? The underlying type ought to be set by the time we see
a using, and it shouldn't be a TEMPLATE_TYPE_PARM.
Here:
if (!processing_template_decl)
{
/* If we are not processing a template, then nobody should be
providing us with a dependent type. */
gcc_assert (type);
gcc_assert (TREE_CODE (type) != TEMPLATE_TYPE_PARM || is_auto
(type));
return false;
}
type is NULL_TREE.
Like this:
#0 dependent_type_p (type=0x0) at
/scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:19020
#1 0x000000000073301f in supplement_binding_1 (binding=0x7ffff651c7f8,
decl=0x7ffff6521cf0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:448
#2 0x0000000000733a65 in supplement_binding (binding=0x7ffff651c7f8,
decl=0x7ffff6521cf0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:568
#3 0x000000000073e4e0 in push_class_level_binding_1
(name=0x7ffff6534948, x=0x7ffff6521cf0) at
/scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:3162
#4 0x000000000073e545 in push_class_level_binding (name=0x7ffff6534948,
x=0x7ffff6521cf0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:3180
#5 0x000000000073d753 in pushdecl_class_level (x=0x7ffff6521cf0) at
/scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:2914
#6 0x00000000006d9538 in finish_member_declaration
(decl=0x7ffff6521cf0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/semantics.c:2668
#7 0x00000000007469c2 in pushtag_1 (name=0x7ffff6534948,
type=0x7ffff6535498, scope=ts_current) at
/scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:5787
#8 0x0000000000746d78 in pushtag (name=0x7ffff6534948,
type=0x7ffff6535498, scope=ts_current) at
/scratch/Gcc/svn-dirs/trunk/gcc/cp/name-lookup.c:5853
#9 0x0000000000570021 in start_enum (name=0x7ffff6534948,
enumtype=0x7ffff6535498, underlying_type=0x0, scoped_enum_p=false,
is_new=0x7fffffffd3f7) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/decl.c:12146
#10 0x0000000000658dfc in cp_parser_enum_specifier
(parser=0x7ffff6534b00) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/parser.c:14509
Paolo.