This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Visibility problems in gcc 2.95.2
On 09 Oct 2000 at 14:55 (+0700), Denis Perchine wrote:
| On 9 ïËÔÑÂÒØ 2000 14:54, Artem Khodush wrote:
| >
| > This is not a bug.
| > It may seem wrong to you, but that's how c++ works.
| > The declaration of rread in class B hides one in class A.
|
| Could you please give me reference to a standard, if it is not so hard for
| you. I'm just wondering why it is the case. Methods have different
| signatures...
I initially started an email supporting your bug report, but my search
thru the standard found this:
13.2 Declaration matching [over.dcl]
[Example:
class B {
public:
int f(int);
};
class D : public B {
public:
int f(char*);
};
//Here D::f(char*) hides B::f(int) rather than overloading it.
void h(D* pd)
{
pd->f(1); // error:
// D::f(char*) hides B::f(int)
pd->B::f(1); // OK
pd->f("Ben"); // OK, calls D::f
}
-end example]
It does _seem_ overloading resolution could (should?) be used to access
the hidden function, but I guess the language designers know better
than me.
hth.
brent
--
All opinions expressed are My own, unless otherwise attributed. In
presenting facts, I expressly reserve the right to be Wrong. Portions
of this message authored by Me are subject to the Free Thought License.