tmp/tmphoxtj3al/{from.md → to.md}
RENAMED
|
@@ -1,39 +1,38 @@
|
|
| 1 |
#### Class members <a id="class.qual">[[class.qual]]</a>
|
| 2 |
|
| 3 |
If the *nested-name-specifier* of a *qualified-id* nominates a class,
|
| 4 |
the name specified after the *nested-name-specifier* is looked up in the
|
| 5 |
-
scope of the class
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
[*Note 1*: A class member can be referred to using a *qualified-id* at
|
| 10 |
-
any point in its potential scope
|
| 11 |
-
[[basic.scope.class]]). — *end note*]
|
| 12 |
|
| 13 |
The exceptions to the name lookup rule above are the following:
|
| 14 |
|
| 15 |
- the lookup for a destructor is as specified in [[basic.lookup.qual]];
|
| 16 |
- a *conversion-type-id* of a *conversion-function-id* is looked up in
|
| 17 |
the same manner as a *conversion-type-id* in a class member access
|
| 18 |
(see [[basic.lookup.classref]]);
|
| 19 |
- the names in a *template-argument* of a *template-id* are looked up in
|
| 20 |
-
the context in which the entire *postfix-expression* occurs
|
| 21 |
-
- the lookup for a name specified in a *using-declaration*
|
| 22 |
-
[[namespace.udecl]]
|
| 23 |
-
within the same scope
|
| 24 |
|
| 25 |
-
In a lookup in which function names are not ignored[^
|
| 26 |
*nested-name-specifier* nominates a class `C`:
|
| 27 |
|
| 28 |
- if the name specified after the *nested-name-specifier*, when looked
|
| 29 |
-
up in `C`, is the injected-class-name of `C`
|
| 30 |
-
- in a *using-declarator* of a *using-declaration*
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
*
|
| 34 |
-
|
| 35 |
|
| 36 |
the name is instead considered to name the constructor of class `C`.
|
| 37 |
|
| 38 |
[*Note 2*: For example, the constructor is not an acceptable lookup
|
| 39 |
result in an *elaborated-type-specifier* so the constructor would not be
|
|
@@ -50,11 +49,11 @@ struct B: public A { B(); };
|
|
| 50 |
|
| 51 |
A::A() { }
|
| 52 |
B::B() { }
|
| 53 |
|
| 54 |
B::A ba; // object of type A
|
| 55 |
-
A::A a; // error
|
| 56 |
struct A::A a2; // object of type A
|
| 57 |
```
|
| 58 |
|
| 59 |
— *end example*]
|
| 60 |
|
|
|
|
| 1 |
#### Class members <a id="class.qual">[[class.qual]]</a>
|
| 2 |
|
| 3 |
If the *nested-name-specifier* of a *qualified-id* nominates a class,
|
| 4 |
the name specified after the *nested-name-specifier* is looked up in the
|
| 5 |
+
scope of the class [[class.member.lookup]], except for the cases listed
|
| 6 |
+
below. The name shall represent one or more members of that class or of
|
| 7 |
+
one of its base classes [[class.derived]].
|
| 8 |
|
| 9 |
[*Note 1*: A class member can be referred to using a *qualified-id* at
|
| 10 |
+
any point in its potential scope [[basic.scope.class]]. — *end note*]
|
|
|
|
| 11 |
|
| 12 |
The exceptions to the name lookup rule above are the following:
|
| 13 |
|
| 14 |
- the lookup for a destructor is as specified in [[basic.lookup.qual]];
|
| 15 |
- a *conversion-type-id* of a *conversion-function-id* is looked up in
|
| 16 |
the same manner as a *conversion-type-id* in a class member access
|
| 17 |
(see [[basic.lookup.classref]]);
|
| 18 |
- the names in a *template-argument* of a *template-id* are looked up in
|
| 19 |
+
the context in which the entire *postfix-expression* occurs;
|
| 20 |
+
- the lookup for a name specified in a *using-declaration*
|
| 21 |
+
[[namespace.udecl]] also finds class or enumeration names hidden
|
| 22 |
+
within the same scope [[basic.scope.hiding]].
|
| 23 |
|
| 24 |
+
In a lookup in which function names are not ignored[^8] and the
|
| 25 |
*nested-name-specifier* nominates a class `C`:
|
| 26 |
|
| 27 |
- if the name specified after the *nested-name-specifier*, when looked
|
| 28 |
+
up in `C`, is the injected-class-name of `C` [[class.pre]], or
|
| 29 |
+
- in a *using-declarator* of a *using-declaration* [[namespace.udecl]]
|
| 30 |
+
that is a *member-declaration*, if the name specified after the
|
| 31 |
+
*nested-name-specifier* is the same as the *identifier* or the
|
| 32 |
+
*simple-template-id*’s *template-name* in the last component of the
|
| 33 |
+
*nested-name-specifier*,
|
| 34 |
|
| 35 |
the name is instead considered to name the constructor of class `C`.
|
| 36 |
|
| 37 |
[*Note 2*: For example, the constructor is not an acceptable lookup
|
| 38 |
result in an *elaborated-type-specifier* so the constructor would not be
|
|
|
|
| 49 |
|
| 50 |
A::A() { }
|
| 51 |
B::B() { }
|
| 52 |
|
| 53 |
B::A ba; // object of type A
|
| 54 |
+
A::A a; // error: A::A is not a type name
|
| 55 |
struct A::A a2; // object of type A
|
| 56 |
```
|
| 57 |
|
| 58 |
— *end example*]
|
| 59 |
|