This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Declaration of static friend function
- To: assaf dot mevorach at intel dot com
- Subject: Re: Declaration of static friend function
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sun, 14 May 2000 19:22:38 +0200
- CC: gcc at gcc dot gnu dot org
- References: <71984F8FB76AD211AC3E00A0C9C578C701C4D045@hasmsx32.iil.intel.com>
> friend static A* A_maker::make(MachineType mtype); <-- this line fails
[...]
> "storage class specifiers invalid in friend function declarations"
> Is it true that this version doesn't support static friends ?
> does anyone knows if this feature is supported in the current version
> (2.95.2) ?
GCC does support "static friends", in any version. However, in
standard C++, you don't need to redeclare that the friend function is
static. IOW, remove the "static" from the friend, and your code should
be accepted, and still do what you want.
Hope this helps,
Martin