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]

Re: c++/10511: tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679


Synopsis: tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679

State-Changed-From-To: open->closed
State-Changed-By: reichelt
State-Changed-When: Mon Apr 28 13:05:37 2003
State-Changed-Why:
    Fixed on 3.3 branch and mainline.
    The bug is still present in gcc 3.2.3, but since the 3.2 branch
    is closed now, there'll be no fix for the 3.2 branch.
    
    With 3.3 branch or mainline one gets 2 error messages instead of the ICE:
    
    PR10511.cc: In member function `void Zoo::B::Fooey(Zoo::A*)':
    PR10511.cc:59: error: assuming pointer to member `void Zoo::B::TFUNC_B(Zoo::A*) 
       [with Zoo::A*Zoo::A::*w_aa = &Zoo::A::m_mem1, Zoo::A*Zoo::A::*w_ab = 
       &Zoo::A::m_mem2, Zoo::A*Zoo::A::*w_ac = &Zoo::A::m_mem3, 
       Zoo::A*Zoo::B::*w_ba = &Zoo::B::m_b1, Zoo::A*Zoo::B::*w_bb = &Zoo::B::m_b2, 
       Zoo::A*Zoo::B::*w_bc = &Zoo::B::m_b3]'
    PR10511.cc:59: error: (a pointer to member can only be formed with `&
       Zoo::B::TFUNC_B(Zoo::A*) [with Zoo::A*Zoo::A::*w_aa = &Zoo::A::m_mem1, 
       Zoo::A*Zoo::A::*w_ab = &Zoo::A::m_mem2, Zoo::A*Zoo::A::*w_ac = 
       &Zoo::A::m_mem3, Zoo::A*Zoo::B::*w_ba = &Zoo::B::m_b1, Zoo::A*Zoo::B::*w_bb 
       = &Zoo::B::m_b2, Zoo::A*Zoo::B::*w_bc = &Zoo::B::m_b3]')
    
    and
    
    PR10511.cc: In member function `void Zoo::B::TFUNC_B(Zoo::A*) [with 
       Zoo::A*Zoo::A::*w_aa = &Zoo::A::m_mem1, Zoo::A*Zoo::A::*w_ab = 
       &Zoo::A::m_mem2, Zoo::A*Zoo::A::*w_ac = &Zoo::A::m_mem3, 
       Zoo::A*Zoo::B::*w_ba = &Zoo::B::m_b1, Zoo::A*Zoo::B::*w_bb = &Zoo::B::m_b2, 
       Zoo::A*Zoo::B::*w_bc = &Zoo::B::m_b3]':
    PR10511.cc:59:   instantiated from here
    PR10511.cc:52: error: invalid use of member (did you forget the `&' ?)
    PR10511.cc:52: error: comparison between distinct pointer types `
       Zoo::A*Zoo::B::*' and `Zoo::A*' lacks a cast
    
    
    After fixing the first bug by writing
      ff gg = &B::TFUNC_B<...
    instead of
      ff gg = TFUNC_B<...
    the ICE on the 3.2 branch disappears and the second error message is printed.
    
    The second error message is discussed in PR 10514, so I won't comment on
    that one here.
    
    BTW,
    the ICE on the 3.2 branch can be shown with the following shorter example:
    
    ===========================snip here================================
    struct A
    {
        struct B
        {
            template <int> void foo () {}
    
            typedef void (B::* fptr)();
    
            void bar() { fptr f = foo<0>; } // should be: fptr f = &B::foo<0>;
        };
    };
    ===========================snip here================================
    
    Regards,
    Volker

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10511


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