From Jason Turner

[temp.dep.constexpr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpk0rlduld/{from.md → to.md} +36 -6
tmp/tmpk0rlduld/{from.md → to.md} RENAMED
@@ -2,15 +2,18 @@
2
 
3
  Except as described below, an expression used in a context where a
4
  constant expression is required is value-dependent if any subexpression
5
  is value-dependent.
6
 
7
- An *id-expression* is value-dependent if:
8
 
9
- - it is a concept-id and any of its arguments are dependent,
 
10
  - it is type-dependent,
11
- - it is the name of a non-type template parameter,
 
 
12
  - it names a static data member that is a dependent member of the
13
  current instantiation and is not initialized in a *member-declarator*,
14
  - it names a static member function that is a dependent member of the
15
  current instantiation, or
16
  - it names a potentially-constant variable [[expr.const]] that is
@@ -24,38 +27,65 @@ dependent:
24
  sizeof unary-expression
25
  sizeof '(' type-id ')'
26
  typeid '(' expression ')'
27
  typeid '(' type-id ')'
28
  alignof '(' type-id ')'
29
- noexcept '(' expression ')'
30
  ```
31
 
32
  [*Note 1*: For the standard library macro `offsetof`, see 
33
  [[support.types]]. — *end note*]
34
 
35
  Expressions of the following form are value-dependent if either the
36
- *type-id* or *simple-type-specifier* is dependent or the *expression* or
37
- *cast-expression* is value-dependent:
 
 
38
 
39
  ``` bnf
40
  simple-type-specifier '(' expression-listₒₚₜ ')'
 
 
 
41
  static_cast '<' type-id '>' '(' expression ')'
42
  const_cast '<' type-id '>' '(' expression ')'
43
  reinterpret_cast '<' type-id '>' '(' expression ')'
 
44
  '(' type-id ')' cast-expression
45
  ```
46
 
47
  Expressions of the following form are value-dependent:
48
 
49
  ``` bnf
50
  sizeof '...' '(' identifier ')'
51
  fold-expression
52
  ```
53
 
 
 
 
 
 
 
54
  An expression of the form `&`*qualified-id* where the *qualified-id*
55
  names a dependent member of the current instantiation is
56
  value-dependent. An expression of the form `&`*cast-expression* is also
57
  value-dependent if evaluating *cast-expression* as a core constant
58
  expression [[expr.const]] succeeds and the result of the evaluation
59
  refers to a templated entity that is an object with static or thread
60
  storage duration or a member function.
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  Except as described below, an expression used in a context where a
4
  constant expression is required is value-dependent if any subexpression
5
  is value-dependent.
6
 
7
+ An *id-expression* is value-dependent if
8
 
9
+ - it is a concept-id and its *concept-name* is dependent or any of its
10
+ arguments are dependent [[temp.dep.temp]],
11
  - it is type-dependent,
12
+ - it is the name of a constant template parameter,
13
+ - it is a name introduced by the *for-range-declaration* of an
14
+ *expansion-statement* [[stmt.expand]],
15
  - it names a static data member that is a dependent member of the
16
  current instantiation and is not initialized in a *member-declarator*,
17
  - it names a static member function that is a dependent member of the
18
  current instantiation, or
19
  - it names a potentially-constant variable [[expr.const]] that is
 
27
  sizeof unary-expression
28
  sizeof '(' type-id ')'
29
  typeid '(' expression ')'
30
  typeid '(' type-id ')'
31
  alignof '(' type-id ')'
 
32
  ```
33
 
34
  [*Note 1*: For the standard library macro `offsetof`, see 
35
  [[support.types]]. — *end note*]
36
 
37
  Expressions of the following form are value-dependent if either the
38
+ *type-id*, *simple-type-specifier*, or *typename-specifier* is dependent
39
+ or the *expression* or *cast-expression* is value-dependent or any
40
+ *expression* in the *expression-list* is value-dependent or any
41
+ *assignment-expression* in the *braced-init-list* is value-dependent:
42
 
43
  ``` bnf
44
  simple-type-specifier '(' expression-listₒₚₜ ')'
45
+ typename-specifier '(' expression-listₒₚₜ ')'
46
+ simple-type-specifier braced-init-list
47
+ typename-specifier braced-init-list
48
  static_cast '<' type-id '>' '(' expression ')'
49
  const_cast '<' type-id '>' '(' expression ')'
50
  reinterpret_cast '<' type-id '>' '(' expression ')'
51
+ dynamic_cast '<' type-id '>' '(' expression ')'
52
  '(' type-id ')' cast-expression
53
  ```
54
 
55
  Expressions of the following form are value-dependent:
56
 
57
  ``` bnf
58
  sizeof '...' '(' identifier ')'
59
  fold-expression
60
  ```
61
 
62
+ unless the *identifier* is a structured binding pack whose initializer
63
+ is not dependent.
64
+
65
+ A *noexcept-expression* [[expr.unary.noexcept]] is value-dependent if
66
+ its *expression* involves a template parameter.
67
+
68
  An expression of the form `&`*qualified-id* where the *qualified-id*
69
  names a dependent member of the current instantiation is
70
  value-dependent. An expression of the form `&`*cast-expression* is also
71
  value-dependent if evaluating *cast-expression* as a core constant
72
  expression [[expr.const]] succeeds and the result of the evaluation
73
  refers to a templated entity that is an object with static or thread
74
  storage duration or a member function.
75
 
76
+ A *reflect-expression* is value-dependent if
77
+
78
+ - it is of the form `^^ reflection-name` and the *reflection-name*
79
+ - is a dependent qualified name,
80
+ - is a dependent *namespace-name*,
81
+ - is the name of a template parameter, or
82
+ - names a dependent member of the current instantiation
83
+ [[temp.dep.type]],
84
+ - it is of the form `^^ type-id` and the *type-id* denotes a dependent
85
+ type, or
86
+ - it is of the form `^^ id-expression` and the *id-expression* is
87
+ value-dependent.
88
+
89
+ A *splice-expression* is value-dependent if its *splice-specifier* or
90
+ *splice-specialization-specifier* is dependent [[temp.dep.splice]].
91
+