|
8697 | 8697 | deduce information used to optimize the program.
|
8698 | 8698 | Implementations are not required to deduce
|
8699 | 8699 | any information from any particular assumption.
|
| 8700 | +It is expected that the value of |
| 8701 | +a \grammarterm{has-attribute-expression} for the \tcode{assume} attribute |
| 8702 | +is \tcode{0} |
| 8703 | +if an implementation does not attempt to deduce |
| 8704 | +any such information from assumptions. |
8700 | 8705 | \end{note}
|
8701 | 8706 | \begin{example}
|
8702 | 8707 | \begin{codeblock}
|
|
8845 | 8850 | declaration that specifies the attribute. The diagnostic message should include the text provided
|
8846 | 8851 | within the \grammarterm{attribute-argument-clause} of any \tcode{deprecated} attribute applied
|
8847 | 8852 | to the name or entity.
|
| 8853 | +The value of |
| 8854 | +a \grammarterm{has-attribute-expression} for the \tcode{deprecated} attribute |
| 8855 | +should be \tcode{0} |
| 8856 | +unless the implementation can issue such diagnostic messages. |
8848 | 8857 |
|
8849 | 8858 | \rSec2[dcl.attr.fallthrough]{Fallthrough attribute}
|
8850 | 8859 | \indextext{attribute!fallthrough}
|
|
8871 | 8880 | a warning that an implementation might otherwise issue
|
8872 | 8881 | for a case or default label that is reachable
|
8873 | 8882 | from another case or default label along some path of execution.
|
| 8883 | +The value of |
| 8884 | +a \grammarterm{has-attribute-expression} for the \tcode{fallthrough} attribute |
| 8885 | +should be \tcode{0} |
| 8886 | +if the attribute does not cause suppression of such warnings. |
8874 | 8887 | Implementations should issue a warning
|
8875 | 8888 | if a fallthrough statement is not dynamically reachable.
|
8876 | 8889 |
|
|
8920 | 8933 | that contains the \grammarterm{attribute-token} \tcode{unlikely}.
|
8921 | 8934 |
|
8922 | 8935 | \pnum
|
8923 |
| -\recommended |
| 8936 | +\begin{note} |
8924 | 8937 | The use of the \tcode{likely} attribute
|
8925 | 8938 | is intended to allow implementations to optimize for
|
8926 | 8939 | the case where paths of execution including it
|
|
8933 | 8946 | are arbitrarily more unlikely
|
8934 | 8947 | than any alternative path of execution
|
8935 | 8948 | that does not include such an attribute on a statement or label.
|
| 8949 | +It is expected that the value of a \grammarterm{has-attribute-expression} |
| 8950 | +for the \tcode{likely} and \tcode{unlikely} attributes |
| 8951 | +is \tcode{0} |
| 8952 | +if the implementation does not attempt to use these attributes |
| 8953 | +for such optimizations. |
8936 | 8954 | A path of execution includes a label
|
8937 | 8955 | if and only if it contains a jump to that label.
|
| 8956 | +\end{note} |
8938 | 8957 | \begin{note}
|
8939 | 8958 | Excessive usage of either of these attributes
|
8940 | 8959 | is liable to result in performance degradation.
|
|
8995 | 9014 | For a structured binding declaration not marked \tcode{maybe_unused},
|
8996 | 9015 | implementations should not emit such a warning unless
|
8997 | 9016 | all of its structured bindings are unused.
|
| 9017 | +The value of |
| 9018 | +a \grammarterm{has-attribute-expression} for the \tcode{maybe_unused} attribute |
| 9019 | +should be \tcode{0} |
| 9020 | +if the attribute does not cause suppression of such warnings. |
8998 | 9021 |
|
8999 | 9022 | \pnum
|
9000 | 9023 | \begin{example}
|
|
9063 | 9086 | a potentially-evaluated discarded-value expression\iref{expr.prop}
|
9064 | 9087 | is discouraged unless explicitly cast to \keyword{void}.
|
9065 | 9088 | Implementations should issue a warning in such cases.
|
| 9089 | +The value of |
| 9090 | +a \grammarterm{has-attribute-expression} for the \tcode{nodiscard} attribute |
| 9091 | +should be \tcode{0} unless the implementation can issue such warnings. |
9066 | 9092 | \begin{note}
|
9067 | 9093 | This is typically because discarding the return value
|
9068 | 9094 | of a nodiscard call has surprising consequences.
|
|
9125 | 9151 | \recommended
|
9126 | 9152 | Implementations should issue a
|
9127 | 9153 | warning if a function marked \tcode{[[noreturn]]} might return.
|
| 9154 | +The value of |
| 9155 | +a \grammarterm{has-attribute-expression} for the \tcode{noreturn} attribute |
| 9156 | +should be \tcode{0} unless the implementation can issue such warnings. |
9128 | 9157 |
|
9129 | 9158 | \pnum
|
9130 | 9159 | \begin{example}
|
|
9159 | 9188 | at the end of the object
|
9160 | 9189 | can be reused as storage for other members.
|
9161 | 9190 | \end{note}
|
| 9191 | + |
| 9192 | +\recommended |
| 9193 | +The value of a \grammarterm{has-attribute-expression} |
| 9194 | +for the \tcode{no_unique_address} attribute |
| 9195 | +should be \tcode{0} for a given implementation |
| 9196 | +unless this attribute can cause a potentially-overlapping subobject |
| 9197 | +to have zero size. |
| 9198 | + |
9162 | 9199 | \begin{example}
|
9163 | 9200 | \begin{codeblock}
|
9164 | 9201 | template<typename Key, typename Value,
|
|
0 commit comments