Created on 2014-03-16.00:00:00 last changed 28 months ago
Notes from the June, 2014 meeting:
CWG felt that these examples should be well-formed.
[Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to DR at the February, 2021 meeting.]
The resolution of issue 407 does not cover cases involving using-declarations. For example:
namespace A { struct S {}; } namespace B { // This is valid per issue 407 using A::S; typedef A::S S; struct S s; } namespace C { // The typedef does not redefine the name S in this // scope, so issue 407's resolution does not apply. typedef A::S S; using A::S; // The name lookup here isn't ambiguous, because it only finds one // entity, but it finds both a typedef-name and a non-typedef-name referring // to that entity, so the standard doesn't appear to say whether this is valid. struct S s; }
The same issue appears with using-directives:
namespace D { typedef A::S S; }
namespace E {
using namespace A;
using namespace D;
struct S s; // ok? issue 407 doesn't apply here either
}
One possibility might be to remove the rule that a typedef-name declaration redefines an already-defined name and instead rely on struct stat-style hiding, taking the non-typedef-name if name lookup finds both and they refer to the same type.
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-08-19 07:54:33 | admin | set | status: drwp -> cd6 |
2021-02-24 00:00:00 | admin | set | status: accepted -> drwp |
2020-12-15 00:00:00 | admin | set | status: open -> accepted |
2014-07-07 00:00:00 | admin | set | messages: + msg5102 |
2014-03-16 00:00:00 | admin | create |