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++/16810] New: Legal (?) C++ program with cast gives ICE in build_ptrmemfunc


The following C++ program will not compile with g++ versions 3.4.1 or 3.5,
I tried the ia64-hp-hpux11.22 platform as well as hppa-hp-hpux11.00.


struct C {
    virtual void f() {}
};

struct B {virtual ~B() {} };

class D : public B, public C
{
public:
    virtual void f() {}
};

typedef void ( C::*FP)();
typedef void ( D::*D_f)();

int main() {
  D *d = new D();
  C *c = d;

  const FP fptr = (FP) &D::f;;
  (d->* (D_f)fptr)();
}

-----------------------------------

/usr/local/bin/g++ -c x.C
x.C: In function `int main()':
x.C:21: internal compiler error: in build_ptrmemfunc, at cp/typeck.c:5512
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 
           Summary: Legal (?) C++ program with cast gives ICE in
                    build_ptrmemfunc
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sje at cup dot hp dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ia64-hp-hpux11.22
  GCC host triplet: ia64-hp-hpux11.22
GCC target triplet: ia64-hp-hpux11.22


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


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