This is the mail archive of the gcc-prs@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]

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



>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:


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