This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25238] Regression in compiling c++



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]