c++/2130: problem at compilation when using friend with a template class

francois.sugny@wanadoo.fr francois.sugny@wanadoo.fr
Wed Feb 28 16:26:00 GMT 2001


>Number:         2130
>Category:       c++
>Synopsis:       problem at compilation when using friend with a template class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 28 16:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     SkunkLabs
>Release:        unknown-1.0
>Organization:
>Environment:
Linux RedHat 7.0 with snapshot 20010228
>Description:
the use of friend has a bug, we cannot use anymore
a predefined type using typedef

  typedef CCOMptr<const MyClass> ptr;
  friend ptr;


>How-To-Repeat:
just try to compile using
gcc test.cpp
>Fix:
just replace ptr in the friend definition :
  typedef CCOMptr<const MyClass> ptr;
  friend ptr;
=>
  typedef CCOMptr<const MyClass> ptr;
  friend CCOMptr<const MyClass>;

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



More information about the Gcc-bugs mailing list