tmp/tmpp4taysrp/{from.md → to.md}
RENAMED
|
@@ -7,22 +7,24 @@ nominating the global namespace), the name specified after the
|
|
| 7 |
names in a *template-argument* of a *template-id* are looked up in the
|
| 8 |
context in which the entire *postfix-expression* occurs.
|
| 9 |
|
| 10 |
For a namespace `X` and name `m`, the namespace-qualified lookup set
|
| 11 |
S(X, m) is defined as follows: Let S'(X, m) be the set of all
|
| 12 |
-
declarations of `m` in `X` and the inline namespace set of `X`
|
| 13 |
-
[[namespace.def]]
|
|
|
|
|
|
|
| 14 |
otherwise, S(X, m) is the union of S(Nᵢ, m) for all namespaces Nᵢ
|
| 15 |
nominated by *using-directive*s in `X` and its inline namespace set.
|
| 16 |
|
| 17 |
Given `X::m` (where `X` is a user-declared namespace), or given `::m`
|
| 18 |
(where X is the global namespace), if S(X, m) is the empty set, the
|
| 19 |
program is ill-formed. Otherwise, if S(X, m) has exactly one member, or
|
| 20 |
-
if the context of the reference is a *using-declaration*
|
| 21 |
-
[[namespace.udecl]]
|
| 22 |
-
|
| 23 |
-
|
| 24 |
|
| 25 |
[*Example 1*:
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
int x;
|
|
@@ -158,11 +160,11 @@ void f()
|
|
| 158 |
— *end example*]
|
| 159 |
|
| 160 |
During the lookup of a qualified namespace member name, if the lookup
|
| 161 |
finds more than one declaration of the member, and if one declaration
|
| 162 |
introduces a class name or enumeration name and the other declarations
|
| 163 |
-
|
| 164 |
functions, the non-type name hides the class or enumeration name if and
|
| 165 |
only if the declarations are from the same namespace; otherwise (the
|
| 166 |
declarations are from different namespaces), the program is ill-formed.
|
| 167 |
|
| 168 |
[*Example 4*:
|
|
@@ -195,23 +197,23 @@ has the form
|
|
| 195 |
``` bnf
|
| 196 |
nested-name-specifier unqualified-id
|
| 197 |
```
|
| 198 |
|
| 199 |
the *unqualified-id* shall name a member of the namespace designated by
|
| 200 |
-
the *nested-name-specifier* or of an element of the inline namespace
|
| 201 |
-
|
| 202 |
|
| 203 |
[*Example 5*:
|
| 204 |
|
| 205 |
``` cpp
|
| 206 |
namespace A {
|
| 207 |
namespace B {
|
| 208 |
void f1(int);
|
| 209 |
}
|
| 210 |
using namespace B;
|
| 211 |
}
|
| 212 |
-
void A::f1(int){ } //
|
| 213 |
```
|
| 214 |
|
| 215 |
— *end example*]
|
| 216 |
|
| 217 |
However, in such namespace member declarations, the
|
|
|
|
| 7 |
names in a *template-argument* of a *template-id* are looked up in the
|
| 8 |
context in which the entire *postfix-expression* occurs.
|
| 9 |
|
| 10 |
For a namespace `X` and name `m`, the namespace-qualified lookup set
|
| 11 |
S(X, m) is defined as follows: Let S'(X, m) be the set of all
|
| 12 |
+
declarations of `m` in `X` and the inline namespace set of `X`
|
| 13 |
+
[[namespace.def]] whose potential scope [[basic.scope.namespace]] would
|
| 14 |
+
include the namespace in which `m` is declared at the location of the
|
| 15 |
+
*nested-name-specifier*. If S'(X, m) is not empty, S(X, m) is S'(X, m);
|
| 16 |
otherwise, S(X, m) is the union of S(Nᵢ, m) for all namespaces Nᵢ
|
| 17 |
nominated by *using-directive*s in `X` and its inline namespace set.
|
| 18 |
|
| 19 |
Given `X::m` (where `X` is a user-declared namespace), or given `::m`
|
| 20 |
(where X is the global namespace), if S(X, m) is the empty set, the
|
| 21 |
program is ill-formed. Otherwise, if S(X, m) has exactly one member, or
|
| 22 |
+
if the context of the reference is a *using-declaration*
|
| 23 |
+
[[namespace.udecl]], S(X, m) is the required set of declarations of `m`.
|
| 24 |
+
Otherwise if the use of `m` is not one that allows a unique declaration
|
| 25 |
+
to be chosen from S(X, m), the program is ill-formed.
|
| 26 |
|
| 27 |
[*Example 1*:
|
| 28 |
|
| 29 |
``` cpp
|
| 30 |
int x;
|
|
|
|
| 160 |
— *end example*]
|
| 161 |
|
| 162 |
During the lookup of a qualified namespace member name, if the lookup
|
| 163 |
finds more than one declaration of the member, and if one declaration
|
| 164 |
introduces a class name or enumeration name and the other declarations
|
| 165 |
+
introduce either the same variable, the same enumerator, or a set of
|
| 166 |
functions, the non-type name hides the class or enumeration name if and
|
| 167 |
only if the declarations are from the same namespace; otherwise (the
|
| 168 |
declarations are from different namespaces), the program is ill-formed.
|
| 169 |
|
| 170 |
[*Example 4*:
|
|
|
|
| 197 |
``` bnf
|
| 198 |
nested-name-specifier unqualified-id
|
| 199 |
```
|
| 200 |
|
| 201 |
the *unqualified-id* shall name a member of the namespace designated by
|
| 202 |
+
the *nested-name-specifier* or of an element of the inline namespace set
|
| 203 |
+
[[namespace.def]] of that namespace.
|
| 204 |
|
| 205 |
[*Example 5*:
|
| 206 |
|
| 207 |
``` cpp
|
| 208 |
namespace A {
|
| 209 |
namespace B {
|
| 210 |
void f1(int);
|
| 211 |
}
|
| 212 |
using namespace B;
|
| 213 |
}
|
| 214 |
+
void A::f1(int){ } // error: f1 is not a member of A
|
| 215 |
```
|
| 216 |
|
| 217 |
— *end example*]
|
| 218 |
|
| 219 |
However, in such namespace member declarations, the
|