This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

typename breakage


Hi!

This proglet crashes the compiled on either sparc or i386, even with -O0:

#include <rope>

void bar() {
  crope foo;
}

The crash is in pt.c (tsubst_decl):
5918            /* Check to see if we already have this specialization.  */
5919            if (!local_p)
5920              {
5921                tmpl = DECL_TI_TEMPLATE (t);
			^^^^^^^^^^^^^^^^^^^^ here
5922                gen_tmpl = most_general_template (tmpl);
5923                argvec = tsubst (DECL_TI_ARGS (t), args, /*complain=*/1, in_decl);
5924                spec = retrieve_specialization (gen_tmpl, argvec);
5925              }

 <type_decl 0x70a83b00 _Rope_RopeLeaf
    type <typename_type 0x70a83a80 _Rope_RopeLeaf
        type <record_type 0x708ddc00 _Rope_RopeLeaf<_CharT,_Alloc> type_1 type_2 type_5 VOID
            size <integer_cst 0x70025280 constant 0>
            align 1 symtab 0 alias set -1 fields <const_decl 0x7090a280 _S_alloc_granularity>
            ~X() n_parents 1 use_template=0 interface-unknown vtable-needs-writing
            member-functions <tree_vec 0x709064c0
                elt 0 <function_decl 0x7090aa80 _Rope_RopeLeaf>
                elt 1 <function_decl 0x7090ad80 _Rope_RopeLeaf>
                elt 2 <function_decl 0x7090a400 _S_rounded_up_size>>
            pointer_to_this <pointer_type 0x708ddc80> chain <type_decl 0x708ddd00 _Rope_RopeLeaf<_CharT,_Alloc>>>
        VOID
        align 1 symtab 0 alias set 0 context <record_type 0x708ddc00 _Rope_RopeLeaf<_CharT,_Alloc>>
        chain <type_decl 0x70a83b00 _Rope_RopeLeaf>>
    in_system_header VOID file /usr/include/g++-3/ropeimpl.h line 334
    align 1 context <record_type 0x708ddc00 _Rope_RopeLeaf<_CharT,_Alloc>>>

because

t->decl.lang_specific == NULL_TREE

Now, my question is: is it ok that DECL_LANG_SPECIFIC for this type is NULL?
If it is legal, then tsubst_decl should probably just check if
DECL_LANG_SPECIFIC is != NULL and if it is not, do some fallback.

	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]