friend declaration implicitly provides a prototype

Bernardo Innocenti bernie@develer.com
Tue Dec 16 22:20:00 GMT 2003


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/




More information about the Gcc mailing list