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]

Re: typedefs and elaborated type specifiers


Matt Austern wrote:-

> On Jan 19, 2005, at 5:42 PM, Mark Mitchell wrote:
> 
> >Matt Austern wrote:
> >>Consider the following code sample:
> >>struct A { };
> >>typedef struct A A;
> >>struct A a;                     // [1]
> >>struct wrapper {
> >>  struct B { };
> >>  typedef struct B B;
> >>  struct B b;                   // [2]
> >>};
> >
> >>Where I'm having trouble: why don't we get the same error in [1]?  
> >>I've searched in vain for any hint that the two cases should be 
> >>treated differently.
> >
> >I haven't searched the standard, but that looks like it should be an 
> >error to me.  I bet that it's merely an accident of G++'s far-too-many 
> >different ways of keeping track of declarations; classes are different 
> >from namespaces...
> 
> OK, that's what Gaby thought too.  I'm going to file an accepts-invalid 
> bug on this.

Oddly EDG accept both in strict mode.

Neil.


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