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:
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...


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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