c++/8424: initialising a pointer-to-member to an array element does not work

bangerth@dealii.org bangerth@dealii.org
Fri Nov 1 09:05:00 GMT 2002


Synopsis: initialising a pointer-to-member to an array element does not work

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Fri Nov  1 09:05:35 2002
State-Changed-Why:
    This is not a bug. Your testcase boils down to
    ---------------------------
    struct A {
        int   b[2];
    };
    
    int (A::*v) = &A::b[0];    // is this valid? If not, why not?
    -------------------------------
    The point is that A::b is not a member variable of type
    "int (B::*)", and one of its elements is not a member
    variable, but -- an element of a member variable. This is
    not supposed to work.

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



More information about the Gcc-bugs mailing list