c++/437: ICE while taking the address of a template static member function

stephane.grad@swing.be stephane.grad@swing.be
Sun Jul 30 11:06:00 GMT 2000


>Number:         437
>Category:       c++
>Synopsis:       ICE while taking the address of a template static member function
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 30 11:06:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Stephane Grad
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
Linux version 2.2.14-15mdk (i586-mandrake-linux)
>Description:
Problem:
Internal compiler error while taking (from a member function) the address of a template static member function defined in the same class.

Error messages:
f.cc: In method `void Y::foo()':
f.cc:24: Internal compiler error.
f.cc:24: Please submit a full bug report.
f.cc:24: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
>How-To-Repeat:
template<class Fn> void f(Fn fn)
{
  fn();
}

struct X
{
  template<class T> static void sm_f()
  {
    // ...
  }
};

struct Y
{
  template<class T> static void sm_f()
  {
    // ...
  }

  void foo()
  {
    f(&X::sm_f<int>); // ok
    f(&Y::sm_f<int>); // Internal compiler error
  }
};
>Fix:

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


More information about the Gcc-prs mailing list