From Jason Turner

[temp.dep.constexpr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp089_3ztz/{from.md → to.md} +26 -3
tmp/tmp089_3ztz/{from.md → to.md} RENAMED
@@ -4,35 +4,58 @@ 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 type-dependent,
10
  - it is the name of a non-type template parameter,
11
  - it names a static data member that is a dependent member of the
12
  current instantiation and is not initialized in a *member-declarator*,
13
  - it names a static member function that is a dependent member of the
14
  current instantiation, or
15
- - it is a constant with literal type and is initialized with an
16
- expression that is value-dependent.
17
 
18
  Expressions of the following form are value-dependent if the
19
  *unary-expression* or *expression* is type-dependent or the *type-id* is
20
  dependent:
21
 
 
 
 
 
 
 
 
 
 
22
  [*Note 1*: For the standard library macro `offsetof`, see 
23
  [[support.types]]. — *end note*]
24
 
25
  Expressions of the following form are value-dependent if either the
26
  *type-id* or *simple-type-specifier* is dependent or the *expression* or
27
  *cast-expression* is value-dependent:
28
 
 
 
 
 
 
 
 
 
29
  Expressions of the following form are value-dependent:
30
 
 
 
 
 
 
31
  An expression of the form `&`*qualified-id* where the *qualified-id*
32
  names a dependent member of the current instantiation is
33
  value-dependent. An expression of the form `&`*cast-expression* is also
34
  value-dependent if evaluating *cast-expression* as a core constant
35
- expression ([[expr.const]]) succeeds and the result of the evaluation
36
  refers to a templated entity that is an object with static or thread
37
  storage duration or a member function.
38
 
 
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
17
+ initialized with an expression that is value-dependent.
18
 
19
  Expressions of the following form are value-dependent if the
20
  *unary-expression* or *expression* is type-dependent or the *type-id* is
21
  dependent:
22
 
23
+ ``` bnf
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