This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35631] operator overloads defined as a friend within a class are not always correctly resolved
- From: "nick dot orlov at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2008 12:44:49 -0000
- Subject: [Bug c++/35631] operator overloads defined as a friend within a class are not always correctly resolved
- References: <bug-35631-4032@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from nick dot orlov at mail dot ru 2008-03-19 12:44 -------
Standard says:
11.4.6. A function can be defined in a friend declaration of a class if and
only if the class is a non-local class (9.8), the function name is unqualified,
and the function has namespace scope.
11.4.7 Such a function is implicitly inline. A friend function defined in a
class is in the (lexical) scope of the class in which it is defined. A friend
function defined outside the class is not (3.4.1)
=======
So I would agree, but in my example operator is being called from a (static)
class method.
--
nick dot orlov at mail dot ru changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35631