- Title
- Definition via unqualified-id and using-declaration
- Status
- cd4
- Section
- _N4868_.9.8.2.3 [namespace.memdef]
- Submitter
- Richard Smith
Created on 2014-01-17.00:00:00 last changed 116 months ago
Messages
Date: 2014-11-15.00:00:00
[Moved to DR at the November, 2014 meeting.]
Date: 2014-07-15.00:00:00
Proposed Resolution (July, 2014): Change _N4868_.9.8.2.3 [namespace.memdef] paragraph 1 as follows:
—end example] Change _N4868_.9.8.2.3 [namespace.memdef] paragraph 3 as follows:
Members (including explicit specializations of templates
(13.9.4 [temp.expl.spec])) of a namespace can be defined
within that namespace. A declaration in a namespace
N (excluding declarations in nested scopes) whose
declarator-id is an unqualified-id declares (or
redeclares) a member of N , and may be a definition.
[Note: An explicit instantiation (13.9.3 [temp.explicit])
or explicit specialization (13.9.4 [temp.expl.spec]) of a
template does not introduce a name and thus may be declared
using an unqualified-id in a member of the enclosing
namespace set, if the primary template is declared in an inline
namespace. —end note] [Example:
namespace X {
void f() { /* ... */ } // OK: introduces X::f()
namespace M {
void g(); // OK: introduces X::M::g()
}
using M::g;
void g(); // error: conflicts with X::M::g()
}
Every name first declared in a namespace is a member of that
namespace. If a friend declaration...
Date: 2014-02-15.00:00:00
Notes from the February, 2014 meeting: CWG agreed that the definition in such cases is a member of the
outer namespace, not a redeclaration of the name introduced in that
namespace by the using-declaration.
Date: 2014-01-17.00:00:00
The Standard is not clear about what happens when an entity is
declared but not defined in an inner namespace and declared via a
using-declaration in an outer namespace, and a definition of an
entity with that name as an unqualified-id appears in the outer
namespace. Is this a legitimate definition of the inner-namespace entity,
as it would be if the definition used a qualified-id, or is the
definition a member of the outer namespace and thus in conflict with
the using-declaration? There is implementation divergence on
the treatment of such definitions.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
| 2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
| 2015-04-13 00:00:00 | admin | set | messages: + msg5370 |
| 2014-11-24 00:00:00 | admin | set | status: tentatively ready -> dr |
| 2014-10-13 00:00:00 | admin | set | messages: + msg5137 |
| 2014-10-13 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2014-03-03 00:00:00 | admin | set | messages: + msg4880 |
| 2014-01-17 00:00:00 | admin | create | |