昨日のgcc4.0とgcc4.2.3とで挙動が違うって話
ARM-style name-injection of friend declarations is no longer the default. For example:
struct S {
friend void f();
};void g() { f(); }
will not be accepted; instead a declaration of f will need to be present outside of the scope of S. The new -ffriend-injection option will enable the old behavior.
だそうな。
Bug 35631 - operator overloads defined as a friend within a class are not always correctly resolvedでは
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.
という話になっている。上のARM-style name-injectionがなくなるという変更はこの使用に基づいたもの?違う気がする。