This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25238] Regression in compiling c++
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2005 02:03:57 -0000
- Subject: [Bug c++/25238] Regression in compiling c++
- References: <bug-25238-11113@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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