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]

Re: gcc and using declarations


> Sorry, I misunderstood a piece of code I dealt with (I'm porting another's
> code initially written under Visual C++); using declaration was used
> to use class declared in another class, like
> 
> class A
> {
>         class B;
> }
> 
> using A::B;
> B b;

It seems that you still misunderstand it. That is not legal C++.

> Does latest gcc support it ?

No, and it shouldn't. g++ also does not support

class A
{
  public:
        class B;
};

class C:A{
  public;
        using A::B;
};

but it should; that is a known bug.

Regards,
Martin

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