"Mike - EMAIL IGNORED" <m_*************@yahoo.com> wrote...
Are static friend functions allowed? I tried this
today with gcc-3.2 without success. The function
was not a class member. The friend statement was
interpreted as meaning "extern", and this was
reported incompatible with a previous static
declaration.
Chapter and verse would also be helpful. I looked
around but didn't find anything.
Apparently gcc-3.2 is buggy. The Standard, 11.4/3
_clearly_ says: "A function first declared in a friend
declaration has external linkage (3.5). Otherwise, the
function retains its previous linkage (7.1.1)." So,
if the function has been declared static before being
declared 'friend', it must be accepted.
Keep in mind, though, that "No storage-class-specifier
shall appear in the decl-specifier-seq of a friend
declaration." (11.4/6)
HTH
Next time post the code.
Victor