Bug 55003 - GCC ICE with virtual method as template argument
GCC ICE with virtual method as template argument
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2001-10-24 03:12 EDT by Need Real Name
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-12-15 12:58:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-10-24 03:12:16 EDT
Description of Problem:

Get ICE with virtual member functions as a template argument.
Works fine for normal member functions or when the template
is defined outside the class which declares the virtual method.

Version-Release number of selected component (if applicable):

dave@quokka:~/tries> g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)

How Reproducible:

Every Time

Steps to Reproduce:
1. Compile example (has no depenencies)
dave@quokka:~/tries> cat virttemparg.cc
template <typename H, 
	  void (H::*fn)()>
struct Bar
  H* h;
  Bar(H* _h) : h(_h) {}
  void Baz() { (h->*fn)(); }

struct Foo 
  void NormFn() { }
  virtual void VirtFn() = 0;

  Bar<Foo, &Foo::NormFn> norm;
  Bar<Foo, &Foo::VirtFn> virt;

  Foo() : norm(this), virt(this)  {}
  virtual ~Foo() {}

struct FooImp
  : public Foo
  virtual void VirtFn() { }

  FooImp() : Foo() {}
  virtual ~FooImp() {}

int main()
  FooImp foo;
  Bar<Foo, &Foo::VirtFn> virt(&foo);

Actual Results:

dave@quokka:~/tries> g++ virttemparg.cc
virttemparg.cc:16: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

Expected Results:

Additional Information:
Comment 1 Alan Cox 2002-12-15 12:58:34 EST
Ok with g++ 3.2

Note You need to log in before you can comment on or make changes to this bug.