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]
Other format: [Raw text]

[Bug c++/22147] [4.1 regression] ICE in get_bindings


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-09-09 09:42 -------
If this is valid I won't be able to fix this really.  Because just adding
a forward declaration of class X fixes the problem the "simple fix"

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.1029
diff -c -3 -p -r1.1029 pt.c
*** cp/pt.c     5 Sep 2005 16:12:13 -0000       1.1029
--- cp/pt.c     9 Sep 2005 08:22:06 -0000
*************** get_bindings (tree fn, tree decl, tree e
*** 10652,10657 ****
--- 10652,10660 ----
        /* We can get here for some invalid specializations.  */
        return NULL_TREE;

+       if (TREE_CODE (tmpl) == OVERLOAD)
+       tmpl = OVL_FUNCTION (tmpl);
+
        converted_args
        = (coerce_template_parms (DECL_INNERMOST_TEMPLATE_PARMS (tmpl),
                                  explicit_args, NULL_TREE,

is for sure not the right one ;)

Backtrace fyi

#1  0x08443a42 in tree_contains_struct_check_failed (node=0x8620bc2, 
    en=140643266, file=0x85827f4 "../../../src/gcc-unpatched/gcc/cp/pt.c", 
    line=10656, function=0x858596d "get_bindings") at tree.c:5933
#2  0x080b654f in get_bindings (fn=0x40211b60, decl=0x40236000, 
    explicit_args=0x40233888, check_rettype=1 '\001') at pt.c:10656
#3  0x0807d011 in determine_specialization (template_id=0x40194168, 
    decl=0x40236000, targs_out=0xbfca1f50, need_member_template=0, 
    template_count=1) at pt.c:1430
#4  0x08092640 in tsubst_friend_function (decl=0x40230e80, args=0x40233a38)
    at pt.c:5106
#5  0x080976ec in instantiate_class_template (type=0x40231c94) at pt.c:5859
#6  0x08102db0 in complete_type (type=0x40231c94) at typeck.c:118
#7  0x0811420b in convert_to_void (expr=0x4020f560, 
    implicit=0x858e62d "statement") at cvt.c:863
#8  0x08129220 in finish_expr_stmt (expr=0x4020f560) at semantics.c:589
...

note that determine_specialization seems to deal with overloads already,
so maybe should not call get_bindings here.  whatever.

NOT looking into this further.

-- 


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


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