Title
Typedefs and tags
Status
cd6
Section
9.2.4 [dcl.typedef]
Submitter
Richard Smith

Created on 2015-11-12.00:00:00 last changed 27 months ago

Messages

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to DR at the February, 2021 meeting.]

It is still unclear how typedefs and elaborated-type-specifiers interact in some cases. For example:

    namespace A {
      struct S {};
    }
    namespace B {
      typedef int S;
    }
    namespace C {
      using namespace A;
      using namespace B;
      struct S s; // clearly ambiguous, S names different entities
    }
    namespace D {
      using A::S;
      typedef struct S S;
      struct S s; // OK under issue 407: S could be used in an
                  //  elaborated-type-specifier before the typedef, so still can be
    }
    namespace E {
      typedef A::S S;
      using A::S;
      struct S s; // ??? the identifier S could not have been used in an
                  // elaborated-type-specifier prior to the typedef, so is this lookup
                  // ill-formed because it finds a typedef-name?
    }
    namespace F {
      typedef A::S S;
    }
    namespace G {
      using namespace A;
      using namespace F;
      struct S s; // ??? F::S could not have been used as an
                  // elaborated-type-specifier before the typedef. is this ill-formed because
                  // the lookup finds a typedef-name?
    }
    namespace H {
      using namespace F;
      using namespace A;
      struct S s; // some implementations give different answers for G and H
    }
History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: accepted -> drwp
2020-12-15 00:00:00adminsetstatus: drafting -> accepted
2018-02-27 00:00:00adminsetstatus: open -> drafting
2015-11-12 00:00:00admincreate