diff --git a/source/declarations.tex b/source/declarations.tex index e244170c6b..124905b8f6 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -8746,6 +8746,11 @@ deduce information used to optimize the program. Implementations are not required to deduce any information from any particular assumption. +It is expected that the value of +a \grammarterm{has-attribute-expression} for the \tcode{assume} attribute +is \tcode{0} +if an implementation does not attempt to deduce +any such information from assumptions. \end{note} \begin{example} \begin{codeblock} @@ -8894,6 +8899,10 @@ declaration that specifies the attribute. The diagnostic message should include the text provided within the \grammarterm{attribute-argument-clause} of any \tcode{deprecated} attribute applied to the name or entity. +The value of +a \grammarterm{has-attribute-expression} for the \tcode{deprecated} attribute +should be \tcode{0} +unless the implementation can issue such diagnostic messages. \rSec2[dcl.attr.fallthrough]{Fallthrough attribute} \indextext{attribute!fallthrough} @@ -8920,6 +8929,10 @@ a warning that an implementation might otherwise issue for a case or default label that is reachable from another case or default label along some path of execution. +The value of +a \grammarterm{has-attribute-expression} for the \tcode{fallthrough} attribute +should be \tcode{0} +if the attribute does not cause suppression of such warnings. Implementations should issue a warning if a fallthrough statement is not dynamically reachable. @@ -8969,7 +8982,7 @@ that contains the \grammarterm{attribute-token} \tcode{unlikely}. \pnum -\recommended +\begin{note} The use of the \tcode{likely} attribute is intended to allow implementations to optimize for the case where paths of execution including it @@ -8982,8 +8995,14 @@ are arbitrarily more unlikely than any alternative path of execution that does not include such an attribute on a statement or label. +It is expected that the value of a \grammarterm{has-attribute-expression} +for the \tcode{likely} and \tcode{unlikely} attributes +is \tcode{0} +if the implementation does not attempt to use these attributes +for such optimizations. A path of execution includes a label if and only if it contains a jump to that label. +\end{note} \begin{note} Excessive usage of either of these attributes is liable to result in performance degradation. @@ -9044,6 +9063,10 @@ For a structured binding declaration not marked \tcode{maybe_unused}, implementations should not emit such a warning unless all of its structured bindings are unused. +The value of +a \grammarterm{has-attribute-expression} for the \tcode{maybe_unused} attribute +should be \tcode{0} +if the attribute does not cause suppression of such warnings. \pnum \begin{example} @@ -9112,6 +9135,9 @@ a potentially-evaluated discarded-value expression\iref{expr.prop} is discouraged unless explicitly cast to \keyword{void}. Implementations should issue a warning in such cases. +The value of +a \grammarterm{has-attribute-expression} for the \tcode{nodiscard} attribute +should be \tcode{0} unless the implementation can issue such warnings. \begin{note} This is typically because discarding the return value of a nodiscard call has surprising consequences. @@ -9174,6 +9200,9 @@ \recommended Implementations should issue a warning if a function marked \tcode{[[noreturn]]} might return. +The value of +a \grammarterm{has-attribute-expression} for the \tcode{noreturn} attribute +should be \tcode{0} unless the implementation can issue such warnings. \pnum \begin{example} @@ -9208,6 +9237,14 @@ at the end of the object can be reused as storage for other members. \end{note} + +\recommended +The value of a \grammarterm{has-attribute-expression} +for the \tcode{no_unique_address} attribute +should be \tcode{0} for a given implementation +unless this attribute can cause a potentially-overlapping subobject +to have zero size. + \begin{example} \begin{codeblock} template