tmp/tmpi7zafsxx/{from.md → to.md}
RENAMED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
### Nodiscard attribute <a id="dcl.attr.nodiscard">[[dcl.attr.nodiscard]]</a>
|
| 2 |
|
| 3 |
-
The *attribute-token* `nodiscard` may be applied to
|
| 4 |
-
|
| 5 |
-
enumeration. It shall appear at most once in each *attribute-list*. An
|
| 6 |
*attribute-argument-clause* may be present and, if present, shall have
|
| 7 |
the form:
|
| 8 |
|
| 9 |
``` bnf
|
| 10 |
'(' string-literal ')'
|
|
@@ -27,14 +26,15 @@ type marked `nodiscard` in a reachable declaration. A *nodiscard call*
|
|
| 27 |
is either
|
| 28 |
|
| 29 |
- a function call expression [[expr.call]] that calls a function
|
| 30 |
declared `nodiscard` in a reachable declaration or whose return type
|
| 31 |
is a nodiscard type, or
|
| 32 |
-
- an explicit type conversion
|
| 33 |
-
[[expr.static.cast]], [[expr.cast]]
|
| 34 |
-
a constructor declared `nodiscard` in a
|
| 35 |
-
initializes an object of a nodiscard
|
|
|
|
| 36 |
|
| 37 |
*Recommended practice:* Appearance of a nodiscard call as a
|
| 38 |
potentially-evaluated discarded-value expression [[expr.prop]] is
|
| 39 |
discouraged unless explicitly cast to `void`. Implementations should
|
| 40 |
issue a warning in such cases.
|
|
|
|
| 1 |
### Nodiscard attribute <a id="dcl.attr.nodiscard">[[dcl.attr.nodiscard]]</a>
|
| 2 |
|
| 3 |
+
The *attribute-token* `nodiscard` may be applied to a function or a
|
| 4 |
+
lambda call operator or to the declaration of a class or enumeration. An
|
|
|
|
| 5 |
*attribute-argument-clause* may be present and, if present, shall have
|
| 6 |
the form:
|
| 7 |
|
| 8 |
``` bnf
|
| 9 |
'(' string-literal ')'
|
|
|
|
| 26 |
is either
|
| 27 |
|
| 28 |
- a function call expression [[expr.call]] that calls a function
|
| 29 |
declared `nodiscard` in a reachable declaration or whose return type
|
| 30 |
is a nodiscard type, or
|
| 31 |
+
- an explicit type conversion
|
| 32 |
+
[[expr.type.conv]], [[expr.static.cast]], [[expr.cast]] that
|
| 33 |
+
constructs an object through a constructor declared `nodiscard` in a
|
| 34 |
+
reachable declaration, or that initializes an object of a nodiscard
|
| 35 |
+
type.
|
| 36 |
|
| 37 |
*Recommended practice:* Appearance of a nodiscard call as a
|
| 38 |
potentially-evaluated discarded-value expression [[expr.prop]] is
|
| 39 |
discouraged unless explicitly cast to `void`. Implementations should
|
| 40 |
issue a warning in such cases.
|