|
8746 | 8746 | deduce information used to optimize the program.
|
8747 | 8747 | Implementations are not required to deduce
|
8748 | 8748 | any information from any particular assumption.
|
| 8749 | +It is expected that the value of |
| 8750 | +a \grammarterm{has-attribute-expression} for the \tcode{assume} attribute |
| 8751 | +is \tcode{0} |
| 8752 | +if an implementation does not attempt to deduce |
| 8753 | +any such information from assumptions. |
8749 | 8754 | \end{note}
|
8750 | 8755 | \begin{example}
|
8751 | 8756 | \begin{codeblock}
|
|
8894 | 8899 | declaration that specifies the attribute. The diagnostic message should include the text provided
|
8895 | 8900 | within the \grammarterm{attribute-argument-clause} of any \tcode{deprecated} attribute applied
|
8896 | 8901 | to the name or entity.
|
| 8902 | +The value of |
| 8903 | +a \grammarterm{has-attribute-expression} for the \tcode{deprecated} attribute |
| 8904 | +should be \tcode{0} |
| 8905 | +unless the implementation can issue such diagnostic messages. |
8897 | 8906 |
|
8898 | 8907 | \rSec2[dcl.attr.fallthrough]{Fallthrough attribute}
|
8899 | 8908 | \indextext{attribute!fallthrough}
|
|
8920 | 8929 | a warning that an implementation might otherwise issue
|
8921 | 8930 | for a case or default label that is reachable
|
8922 | 8931 | from another case or default label along some path of execution.
|
| 8932 | +The value of |
| 8933 | +a \grammarterm{has-attribute-expression} for the \tcode{fallthrough} attribute |
| 8934 | +should be \tcode{0} |
| 8935 | +if the attribute does not cause suppression of such warnings. |
8923 | 8936 | Implementations should issue a warning
|
8924 | 8937 | if a fallthrough statement is not dynamically reachable.
|
8925 | 8938 |
|
|
8969 | 8982 | that contains the \grammarterm{attribute-token} \tcode{unlikely}.
|
8970 | 8983 |
|
8971 | 8984 | \pnum
|
8972 |
| -\recommended |
| 8985 | +\begin{note} |
8973 | 8986 | The use of the \tcode{likely} attribute
|
8974 | 8987 | is intended to allow implementations to optimize for
|
8975 | 8988 | the case where paths of execution including it
|
|
8982 | 8995 | are arbitrarily more unlikely
|
8983 | 8996 | than any alternative path of execution
|
8984 | 8997 | that does not include such an attribute on a statement or label.
|
| 8998 | +It is expected that the value of a \grammarterm{has-attribute-expression} |
| 8999 | +for the \tcode{likely} and \tcode{unlikely} attributes |
| 9000 | +is \tcode{0} |
| 9001 | +if the implementation does not attempt to use these attributes |
| 9002 | +for such optimizations. |
8985 | 9003 | A path of execution includes a label
|
8986 | 9004 | if and only if it contains a jump to that label.
|
| 9005 | +\end{note} |
8987 | 9006 | \begin{note}
|
8988 | 9007 | Excessive usage of either of these attributes
|
8989 | 9008 | is liable to result in performance degradation.
|
|
9044 | 9063 | For a structured binding declaration not marked \tcode{maybe_unused},
|
9045 | 9064 | implementations should not emit such a warning unless
|
9046 | 9065 | all of its structured bindings are unused.
|
| 9066 | +The value of |
| 9067 | +a \grammarterm{has-attribute-expression} for the \tcode{maybe_unused} attribute |
| 9068 | +should be \tcode{0} |
| 9069 | +if the attribute does not cause suppression of such warnings. |
9047 | 9070 |
|
9048 | 9071 | \pnum
|
9049 | 9072 | \begin{example}
|
|
9112 | 9135 | a potentially-evaluated discarded-value expression\iref{expr.prop}
|
9113 | 9136 | is discouraged unless explicitly cast to \keyword{void}.
|
9114 | 9137 | Implementations should issue a warning in such cases.
|
| 9138 | +The value of |
| 9139 | +a \grammarterm{has-attribute-expression} for the \tcode{nodiscard} attribute |
| 9140 | +should be \tcode{0} unless the implementation can issue such warnings. |
9115 | 9141 | \begin{note}
|
9116 | 9142 | This is typically because discarding the return value
|
9117 | 9143 | of a nodiscard call has surprising consequences.
|
|
9174 | 9200 | \recommended
|
9175 | 9201 | Implementations should issue a
|
9176 | 9202 | warning if a function marked \tcode{[[noreturn]]} might return.
|
| 9203 | +The value of |
| 9204 | +a \grammarterm{has-attribute-expression} for the \tcode{noreturn} attribute |
| 9205 | +should be \tcode{0} unless the implementation can issue such warnings. |
9177 | 9206 |
|
9178 | 9207 | \pnum
|
9179 | 9208 | \begin{example}
|
|
9208 | 9237 | at the end of the object
|
9209 | 9238 | can be reused as storage for other members.
|
9210 | 9239 | \end{note}
|
| 9240 | + |
| 9241 | +\recommended |
| 9242 | +The value of a \grammarterm{has-attribute-expression} |
| 9243 | +for the \tcode{no_unique_address} attribute |
| 9244 | +should be \tcode{0} for a given implementation |
| 9245 | +unless this attribute can cause a potentially-overlapping subobject |
| 9246 | +to have zero size. |
| 9247 | + |
9211 | 9248 | \begin{example}
|
9212 | 9249 | \begin{codeblock}
|
9213 | 9250 | template<typename Key, typename Value,
|
|
0 commit comments