This is the mail archive of the gcc@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]

friend declaration implicitly provides a prototype


Hello,

this strikes me as a C++ bug in GCC 3.3.2, but perhaps
I'm just not correctly reading through the lines of the
standard.

class Foo
{
   // No prototype for bar() given
   friend void bar(int);
};

void some_function()
{
	bar(10); // No error for undeclared function!
}


What the standard explicitly requires is that bar() can be accessed in Foo as if it was declared.

This doesn't mean bar(int) is implicitly declared
everywhere, right?

--
 // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/



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