[Bug c++/25238] Regression in compiling c++
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Dec 3 02:03:00 GMT 2005
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-12-03 02:03 -------
This is not a bug, it comes down to something like:
class a
{
friend void f(void);
};
int main(void)
{
f();
}
void f(void) {}
----
Friends don't inject into the scope at all.
In enumNameMap.hh, we have:
class PosRMSDPot ...
{
friend istream& operator>>(istream& s, PosRMSDPot_Restraint& x);
friend ostream& operator<<(ostream& s, const PosRMSDPot_Restraint& x);
friend class PosRMSDPot_Restraint;
};
...
Use >> later on.
The way to fix this is inject the friend your self (or use -ffriend-injection
to work around your invalid code).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25238
More information about the Gcc-bugs
mailing list