This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++: INHERITED_VALUE_BINDING_P
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc at gcc dot gnu dot org, jason at redhat dot com
- Date: 26 Oct 2003 15:52:31 -0800
- Subject: Re: C++: INHERITED_VALUE_BINDING_P
- Organization: CodeSourcery, LLC
- References: <m31xt4rtha.fsf@dromion.integrable-solutions.net>
On Thu, 2003-10-23 at 06:09, Gabriel Dos Reis wrote:
> Hi,
>
> In the C++ front-end, the macro INHERITED_VALUE_BINDING_P is used to
> distinguish a class-scope declaration that is inherited (from a base
> class) from regular ones. I believe that is a carry-over from old ARM
> scope rules. I think we could safely get rid of it because standard
> scope notions make no room for the idea of inherited declaration:
> Instead, each base class retains its scope and declarations in derived
> class hide declarations in base classes.
IIRC, this is not quite true. In particular, this code:
struct A {
struct B {};
};
struct C : public A {
void B();
};
struct C::B b;
is legal. That's the case where INHERITED_VALUE_BINDING_P is used, I
think.
--
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC