From Jason Turner

[dcl.type.elab]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpv_63rq1_/{from.md → to.md} +44 -21
tmp/tmpv_63rq1_/{from.md → to.md} RENAMED
@@ -3,49 +3,72 @@
3
  ``` bnf
4
  elaborated-type-specifier:
5
  class-key attribute-specifier-seqₒₚₜ nested-name-specifierₒₚₜ identifier
6
  class-key simple-template-id
7
  class-key nested-name-specifier templateₒₚₜ simple-template-id
8
- elaborated-enum-specifier
9
- ```
10
-
11
- ``` bnf
12
- elaborated-enum-specifier:
13
  enum nested-name-specifierₒₚₜ identifier
14
  ```
15
 
16
- An *attribute-specifier-seq* shall not appear in an
17
- *elaborated-type-specifier* unless the latter is the sole constituent of
18
- a declaration. If an *elaborated-type-specifier* is the sole constituent
19
- of a declaration, the declaration is ill-formed unless it is an explicit
 
 
20
  specialization [[temp.expl.spec]], an explicit instantiation
21
  [[temp.explicit]] or it has one of the following forms:
22
 
23
  ``` bnf
24
  class-key attribute-specifier-seqₒₚₜ identifier ';'
25
- friend class-key '::ₒₚₜ ' identifier ';'
26
- friend class-key '::ₒₚₜ ' simple-template-id ';'
27
- friend class-key nested-name-specifier identifier ';'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  friend class-key nested-name-specifier templateₒₚₜ simple-template-id ';'
29
  ```
30
 
31
- In the first case, the *attribute-specifier-seq*, if any, appertains to
32
- the class being declared; the attributes in the
33
- *attribute-specifier-seq* are thereafter considered attributes of the
34
- class whenever it is named.
35
 
36
- [*Note 1*: [[basic.lookup.elab]] describes how name lookup proceeds
37
- for the *identifier* in an *elaborated-type-specifier*. *end note*]
 
 
 
 
 
 
38
 
39
  If the *identifier* or *simple-template-id* resolves to a *class-name*
40
  or *enum-name*, the *elaborated-type-specifier* introduces it into the
41
  declaration the same way a *simple-type-specifier* introduces its
42
  *type-name* [[dcl.type.simple]]. If the *identifier* or
43
- *simple-template-id* resolves to a *typedef-name* ([[dcl.typedef]],
44
- [[temp.names]]), the *elaborated-type-specifier* is ill-formed.
 
45
 
46
- [*Note 2*:
47
 
48
  This implies that, within a class template with a template
49
  *type-parameter* `T`, the declaration
50
 
51
  ``` cpp
 
3
  ``` bnf
4
  elaborated-type-specifier:
5
  class-key attribute-specifier-seqₒₚₜ nested-name-specifierₒₚₜ identifier
6
  class-key simple-template-id
7
  class-key nested-name-specifier templateₒₚₜ simple-template-id
 
 
 
 
 
8
  enum nested-name-specifierₒₚₜ identifier
9
  ```
10
 
11
+ The component names of an *elaborated-type-specifier* are its
12
+ *identifier* (if any) and those of its *nested-name-specifier* and
13
+ *simple-template-id* (if any).
14
+
15
+ If an *elaborated-type-specifier* is the sole constituent of a
16
+ declaration, the declaration is ill-formed unless it is an explicit
17
  specialization [[temp.expl.spec]], an explicit instantiation
18
  [[temp.explicit]] or it has one of the following forms:
19
 
20
  ``` bnf
21
  class-key attribute-specifier-seqₒₚₜ identifier ';'
22
+ class-key attribute-specifier-seqₒₚₜ simple-template-id ';'
23
+ ```
24
+
25
+ In the first case, the *elaborated-type-specifier* declares the
26
+ *identifier* as a *class-name*. The second case shall appear only in an
27
+ *explicit-specialization* [[temp.expl.spec]] or in a
28
+ *template-declaration* (where it declares a partial specialization
29
+ [[temp.decls]]). The *attribute-specifier-seq*, if any, appertains to
30
+ the class or template being declared.
31
+
32
+ Otherwise, an *elaborated-type-specifier* E shall not have an
33
+ *attribute-specifier-seq*. If E contains an *identifier* but no
34
+ *nested-name-specifier* and (unqualified) lookup for the *identifier*
35
+ finds nothing, E shall not be introduced by the `enum` keyword and
36
+ declares the *identifier* as a *class-name*. The target scope of E is
37
+ the nearest enclosing namespace or block scope.
38
+
39
+ If an *elaborated-type-specifier* appears with the `friend` specifier as
40
+ an entire *member-declaration*, the *member-declaration* shall have one
41
+ of the following forms:
42
+
43
+ ``` bnf
44
+ friend class-key nested-name-specifierₒₚₜ identifier ';'
45
+ friend class-key simple-template-id ';'
46
  friend class-key nested-name-specifier templateₒₚₜ simple-template-id ';'
47
  ```
48
 
49
+ Any unqualified lookup for the *identifier* (in the first case) does not
50
+ consider scopes that contain the target scope; no name is bound.
 
 
51
 
52
+ [*Note 1*: A *using-directive* in the target scope is ignored if it
53
+ refers to a namespace not contained by that scope. [[basic.lookup.elab]]
54
+ describes how name lookup proceeds in an
55
+ *elaborated-type-specifier*. — *end note*]
56
+
57
+ [*Note 2*: An *elaborated-type-specifier* can be used to refer to a
58
+ previously declared *class-name* or *enum-name* even if the name has
59
+ been hidden by a non-type declaration. — *end note*]
60
 
61
  If the *identifier* or *simple-template-id* resolves to a *class-name*
62
  or *enum-name*, the *elaborated-type-specifier* introduces it into the
63
  declaration the same way a *simple-type-specifier* introduces its
64
  *type-name* [[dcl.type.simple]]. If the *identifier* or
65
+ *simple-template-id* resolves to a *typedef-name*
66
+ [[dcl.typedef]], [[temp.names]], the *elaborated-type-specifier* is
67
+ ill-formed.
68
 
69
+ [*Note 3*:
70
 
71
  This implies that, within a class template with a template
72
  *type-parameter* `T`, the declaration
73
 
74
  ``` cpp