c++/5355: pointer to templated function gives internal error

bmeijer@euronet.nl bmeijer@euronet.nl
Thu Jan 10 16:46:00 GMT 2002


>Number:         5355
>Category:       c++
>Synopsis:       pointer to templated function gives internal error
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 10 16:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Berend Meijer
>Release:        MINGW 2.95.2-1
>Organization:
>Environment:
Windows 98
>Description:
An attempt to create a pointer to a templated member function causes an internal compiler error. See attached minimum code example.
>How-To-Repeat:
class TryIt
{
  public:
    template<typename T> T *create()
    {
      Deletor=destroy<T>;
      return new T;
    }

    template<typename T> void destroy(void *&Ptr)
    {
      Deletor(reinterpret_cast<T *>(Ptr));
    }

  private:
    void (*Deletor)(void *&Ptr);
};

void main()
{
  TryIt Try;
  int *Ptr = Try.create<int>();
}
>Fix:
No workaround found. I'm open to suggestions.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list