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

RE: Declaration of static friend function


This one works although it gives a warning: 
"cannot declare member function `A_maker::make(int)' to have static linkage"
but again it works
Thank you!
Assaf M.

-----Original Message-----
From: Martin v. Loewis [mailto:martin@loewis.home.cs.tu-berlin.de]
Sent: Sunday, May 14, 2000 8:23 PM
To: assaf.mevorach@intel.com
Cc: gcc@gcc.gnu.org
Subject: Re: Declaration of static friend function


>      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


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