public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10511: tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679
@ 2003-04-28 13:05 reichelt
  0 siblings, 0 replies; 2+ messages in thread
From: reichelt @ 2003-04-28 13:05 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gianni, nobody

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/10511: tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679
@ 2003-04-27  4:56 gianni
  0 siblings, 0 replies; 2+ messages in thread
From: gianni @ 2003-04-27  4:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10511
>Category:       c++
>Synopsis:       tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 27 04:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     gianni@mariani.ws
>Release:        gcc (GCC) 3.2.1
>Organization:
>Environment:
Linux RH 7.2

Configured with: /home/gianni/downloads/gcc/gcc-3.2.1/configure --enable-threads=posix --enable-shared --prefix=/home/gianni/downloads/gcc/gcc-3.2.1-install
Thread model: posix
gcc version 3.2.1
>Description:

compiler says it has an error.  It seems like a parser error.  Complete code below the error output.

g++     tt.cpp   -o tt
tt.cpp: In member function `void Zoo::B::Fooey(Zoo::A*)':
tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make: *** [tt] Error 1

class Zoo
{

public:

        class B;

        class A
        {

                public:


                A                       * m_mem1;
                A                       * m_mem2;
                A                       * m_mem3;

                template <
                        A * A::*        w_aa,
                        A * A::*        w_ab,
                        A * A::*        w_ac,
                        A * B::*        w_ba,
                        A * B::*        w_bb,
                        A * B::*        w_bc
                >
                void TFUNC_A( A * i_1 )
                {
                        i_1->w_ac = i_1;
                }

        };

        class B
        {

                public:

                A                       * m_b1;
                A                       * m_b2;
                A                       * m_b3;

                template <
                        A * A::*        w_aa,
                        A * A::*        w_ab,
                        A * A::*        w_ac,
                        A * B::*        w_ba,
                        A * B::*        w_bb,
                        A * B::*        w_bc
                >
                void TFUNC_B( A * i_1 )
                {
                        i_1->TFUNC_A<w_aa,w_ab,w_ac,w_ba,w_bb,w_bc>( m_b1 );
                }

                typedef void ( B::* ff )( A * i_1 );

                void Fooey( A * i_1 )
                {
                        ff      gg = TFUNC_B< (&A::m_mem1),(&A::m_mem2),(&A::m_mem3),(&::Zoo::B::m_b1),(&::Zoo::B::m_b2),(&::Zoo::B::m_b3) >;

                        this->TFUNC_B< (&A::m_mem1),(&A::m_mem2),(&A::m_mem3),(&B::m_b1),(&B::m_b2),(&B::m_b3) >( i_1 );
                }

        };


};


int main()
{
        Zoo::A          a[1];
        Zoo::B          b[1];

        b->Fooey( a );
}



>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-28 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-28 13:05 c++/10511: tt.cpp:61: Internal compiler error in decay_conversion, at cp/typeck.c:1679 reichelt
  -- strict thread matches above, loose matches on Subject: below --
2003-04-27  4:56 gianni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).