Title
Wording problem with issue 56 resolution on redeclaring typedefs in class scope
Status
cd1
Section
9.2.4 [dcl.typedef]
Submitter
Daveed Vandevoorde

Created on 2003-06-25.00:00:00 last changed 189 months ago

Messages

Date: 2004-03-15.00:00:00

[Voted into WP at March 2004 meeting.]

Date: 2003-10-15.00:00:00

Proposed resolution (October 2003):

At the end of 9.2.4 [dcl.typedef] paragraph 2, add the following:

In a given class scope, a typedef specifier can be used to redefine any class-name declared in that scope that is not also a typedef-name to refer to the type to which it already refers. [Example:
  struct S {
    typedef struct A {} A;  // OK
    typedef struct B B;     // OK
    typedef A A;            // error
  };
]
Date: 2003-11-15.00:00:00

I wonder if perhaps the core issue 56 change in 9.2.4 [dcl.typedef] paragraph 2 wasn't quite careful enough. The intent was to remove the allowance for:

  struct S {
    typedef int I;
    typedef int I;
  };

but I think it also disallows the following:

  class B {
    typedef struct A {} A;
    void f(struct B::A*p);
  };

See also issue 407.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2004-04-09 00:00:00adminsetmessages: + msg1010
2004-04-09 00:00:00adminsetstatus: ready -> wp
2003-11-15 00:00:00adminsetmessages: + msg912
2003-11-15 00:00:00adminsetstatus: open -> ready
2003-06-25 00:00:00admincreate