|
8727 | 8727 | deduce information used to optimize the program.
|
8728 | 8728 | Implementations are not required to deduce
|
8729 | 8729 | any information from any particular assumption.
|
| 8730 | +It is expected that the value of |
| 8731 | +a \grammarterm{has-attribute-expression} for the \tcode{assume} attribute |
| 8732 | +is \tcode{0} |
| 8733 | +if an implementation does not attempt to deduce |
| 8734 | +any such information from assumptions. |
8730 | 8735 | \end{note}
|
8731 | 8736 | \begin{example}
|
8732 | 8737 | \begin{codeblock}
|
|
8875 | 8880 | declaration that specifies the attribute. The diagnostic message should include the text provided
|
8876 | 8881 | within the \grammarterm{attribute-argument-clause} of any \tcode{deprecated} attribute applied
|
8877 | 8882 | to the name or entity.
|
| 8883 | +The value of |
| 8884 | +a \grammarterm{has-attribute-expression} for the \tcode{deprecated} attribute |
| 8885 | +should be \tcode{0} |
| 8886 | +unless the implementation can issue such diagnostic messages. |
8878 | 8887 |
|
8879 | 8888 | \rSec2[dcl.attr.fallthrough]{Fallthrough attribute}
|
8880 | 8889 | \indextext{attribute!fallthrough}
|
|
8901 | 8910 | a warning that an implementation might otherwise issue
|
8902 | 8911 | for a case or default label that is reachable
|
8903 | 8912 | from another case or default label along some path of execution.
|
| 8913 | +The value of |
| 8914 | +a \grammarterm{has-attribute-expression} for the \tcode{fallthrough} attribute |
| 8915 | +should be \tcode{0} |
| 8916 | +if the attribute does not cause suppression of such warnings. |
8904 | 8917 | Implementations should issue a warning
|
8905 | 8918 | if a fallthrough statement is not dynamically reachable.
|
8906 | 8919 |
|
|
8950 | 8963 | that contains the \grammarterm{attribute-token} \tcode{unlikely}.
|
8951 | 8964 |
|
8952 | 8965 | \pnum
|
8953 |
| -\recommended |
| 8966 | +\begin{note} |
8954 | 8967 | The use of the \tcode{likely} attribute
|
8955 | 8968 | is intended to allow implementations to optimize for
|
8956 | 8969 | the case where paths of execution including it
|
|
8963 | 8976 | are arbitrarily more unlikely
|
8964 | 8977 | than any alternative path of execution
|
8965 | 8978 | that does not include such an attribute on a statement or label.
|
| 8979 | +It is expected that the value of a \grammarterm{has-attribute-expression} |
| 8980 | +for the \tcode{likely} and \tcode{unlikely} attributes |
| 8981 | +is \tcode{0} |
| 8982 | +if the implementation does not attempt to use these attributes |
| 8983 | +for such optimizations. |
8966 | 8984 | A path of execution includes a label
|
8967 | 8985 | if and only if it contains a jump to that label.
|
| 8986 | +\end{note} |
8968 | 8987 | \begin{note}
|
8969 | 8988 | Excessive usage of either of these attributes
|
8970 | 8989 | is liable to result in performance degradation.
|
|
9025 | 9044 | For a structured binding declaration not marked \tcode{maybe_unused},
|
9026 | 9045 | implementations should not emit such a warning unless
|
9027 | 9046 | all of its structured bindings are unused.
|
| 9047 | +The value of |
| 9048 | +a \grammarterm{has-attribute-expression} for the \tcode{maybe_unused} attribute |
| 9049 | +should be \tcode{0} |
| 9050 | +if the attribute does not cause suppression of such warnings. |
9028 | 9051 |
|
9029 | 9052 | \pnum
|
9030 | 9053 | \begin{example}
|
|
9093 | 9116 | a potentially-evaluated discarded-value expression\iref{expr.prop}
|
9094 | 9117 | is discouraged unless explicitly cast to \keyword{void}.
|
9095 | 9118 | Implementations should issue a warning in such cases.
|
| 9119 | +The value of |
| 9120 | +a \grammarterm{has-attribute-expression} for the \tcode{nodiscard} attribute |
| 9121 | +should be \tcode{0} unless the implementation can issue such warnings. |
9096 | 9122 | \begin{note}
|
9097 | 9123 | This is typically because discarding the return value
|
9098 | 9124 | of a nodiscard call has surprising consequences.
|
|
9155 | 9181 | \recommended
|
9156 | 9182 | Implementations should issue a
|
9157 | 9183 | warning if a function marked \tcode{[[noreturn]]} might return.
|
| 9184 | +The value of |
| 9185 | +a \grammarterm{has-attribute-expression} for the \tcode{noreturn} attribute |
| 9186 | +should be \tcode{0} unless the implementation can issue such warnings. |
9158 | 9187 |
|
9159 | 9188 | \pnum
|
9160 | 9189 | \begin{example}
|
|
9189 | 9218 | at the end of the object
|
9190 | 9219 | can be reused as storage for other members.
|
9191 | 9220 | \end{note}
|
| 9221 | + |
| 9222 | +\recommended |
| 9223 | +The value of a \grammarterm{has-attribute-expression} |
| 9224 | +for the \tcode{no_unique_address} attribute |
| 9225 | +should be \tcode{0} for a given implementation |
| 9226 | +unless this attribute can cause a potentially-overlapping subobject |
| 9227 | +to have zero size. |
| 9228 | + |
9192 | 9229 | \begin{example}
|
9193 | 9230 | \begin{codeblock}
|
9194 | 9231 | template<typename Key, typename Value,
|
|
0 commit comments