|
8766 | 8766 | \grammarterm{attribute-argument-clause}{s}) are allowed.
|
8767 | 8767 |
|
8768 | 8768 | \pnum
|
8769 |
| -\begin{note} |
8770 |
| -Implementations may use the \tcode{deprecated} attribute to produce a diagnostic |
| 8769 | +\recommended |
| 8770 | +Implementations should use the \tcode{deprecated} attribute to produce a diagnostic |
8771 | 8771 | message in case the program refers to a name or entity other than to declare it, after a
|
8772 |
| -declaration that specifies the attribute. The diagnostic message may include the text provided |
| 8772 | +declaration that specifies the attribute. The diagnostic message should include the text provided |
8773 | 8773 | within the \grammarterm{attribute-argument-clause} of any \tcode{deprecated} attribute applied
|
8774 | 8774 | to the name or entity.
|
8775 |
| -\end{note} |
8776 | 8775 |
|
8777 | 8776 | \rSec2[dcl.attr.fallthrough]{Fallthrough attribute}
|
8778 | 8777 | \indextext{attribute!fallthrough}
|
|
8796 | 8795 | The program is ill-formed if there is no such statement.
|
8797 | 8796 |
|
8798 | 8797 | \pnum
|
8799 |
| -\begin{note} |
8800 |
| -The use of a fallthrough statement is intended to suppress |
| 8798 | +\recommended |
| 8799 | +The use of a fallthrough statement should suppress |
8801 | 8800 | a warning that an implementation might otherwise issue
|
8802 | 8801 | for a case or default label that is reachable
|
8803 | 8802 | from another case or default label along some path of execution.
|
8804 | 8803 | Implementations should issue a warning
|
8805 | 8804 | if a fallthrough statement is not dynamically reachable.
|
8806 |
| -\end{note} |
8807 | 8805 |
|
8808 | 8806 | \pnum
|
8809 | 8807 | \begin{example}
|
|
8854 | 8852 | that contains the \grammarterm{attribute-token} \tcode{unlikely}.
|
8855 | 8853 |
|
8856 | 8854 | \pnum
|
8857 |
| -\begin{note} |
| 8855 | +\recommended |
8858 | 8856 | The use of the \tcode{likely} attribute
|
8859 | 8857 | is intended to allow implementations to optimize for
|
8860 | 8858 | the case where paths of execution including it
|
|
8869 | 8867 | that does not include such an attribute on a statement or label.
|
8870 | 8868 | A path of execution includes a label
|
8871 | 8869 | if and only if it contains a jump to that label.
|
| 8870 | +\begin{note} |
8872 | 8871 | Excessive usage of either of these attributes
|
8873 | 8872 | is liable to result in performance degradation.
|
8874 | 8873 | \end{note}
|
|
8914 | 8913 | a function, an enumeration, or an enumerator.
|
8915 | 8914 |
|
8916 | 8915 | \pnum
|
| 8916 | +A name or entity declared without the \tcode{maybe_unused} attribute |
| 8917 | +can later be redeclared with the attribute |
| 8918 | +and vice versa. |
| 8919 | +An entity is considered marked |
| 8920 | +after the first declaration that marks it. |
| 8921 | + |
| 8922 | +\pnum |
| 8923 | +\recommended |
8917 | 8924 | For an entity marked \tcode{maybe_unused},
|
8918 | 8925 | implementations should not emit a warning
|
8919 | 8926 | that the entity or its structured bindings (if any)
|
|
8922 | 8929 | implementations should not emit such a warning unless
|
8923 | 8930 | all of its structured bindings are unused.
|
8924 | 8931 |
|
8925 |
| -\pnum |
8926 |
| -A name or entity declared without the \tcode{maybe_unused} attribute |
8927 |
| -can later be redeclared with the attribute |
8928 |
| -and vice versa. |
8929 |
| -An entity is considered marked |
8930 |
| -after the first declaration that marks it. |
8931 |
| - |
8932 | 8932 | \pnum
|
8933 | 8933 | \begin{example}
|
8934 | 8934 | \begin{codeblock}
|
|
8992 | 8992 | \end{itemize}
|
8993 | 8993 |
|
8994 | 8994 | \pnum
|
8995 |
| -\begin{note} |
| 8995 | +\recommended |
8996 | 8996 | Appearance of a nodiscard call as
|
8997 | 8997 | a potentially-evaluated discarded-value expression\iref{expr.prop}
|
8998 | 8998 | is discouraged unless explicitly cast to \tcode{void}.
|
8999 | 8999 | Implementations should issue a warning in such cases.
|
| 9000 | +\begin{note} |
9000 | 9001 | This is typically because discarding the return value
|
9001 | 9002 | of a nodiscard call has surprising consequences.
|
| 9003 | +\end{note} |
9002 | 9004 | The \grammarterm{string-literal}
|
9003 | 9005 | in a \tcode{nodiscard} \grammarterm{attribute-argument-clause}
|
9004 |
| -is intended to be used in the message of the warning |
| 9006 | +should be used in the message of the warning |
9005 | 9007 | as the rationale for why the result should not be discarded.
|
9006 |
| -\end{note} |
9007 | 9008 |
|
9008 | 9009 | \pnum
|
9009 | 9010 | \begin{example}
|
|
9053 | 9054 | The function may
|
9054 | 9055 | terminate by throwing an exception.
|
9055 | 9056 | \end{note}
|
9056 |
| -\begin{note} |
| 9057 | + |
| 9058 | +\pnum |
| 9059 | +\recommended |
9057 | 9060 | Implementations should issue a
|
9058 | 9061 | warning if a function marked \tcode{[[noreturn]]} might return.
|
9059 |
| -\end{note} |
9060 | 9062 |
|
9061 | 9063 | \pnum
|
9062 | 9064 | \begin{example}
|
|
0 commit comments