This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


965. Limiting the applicability of the carries_dependency attribute

Section: 9.12.4  [dcl.attr.depend]     Status: CD2     Submitter: Daveed Vandevoorde     Date: 15 September, 2009

[Voted into WP at March, 2010 meeting.]

The current wording for the carries_dependency attribute does not limit it to value-returning functions (when applied to the declarator-id, indicating that the return value is affected), nor does it prohibit use in the declaration of a typedef or function pointer. Arguably these meaningless declarations should be prohibited.

Proposed resolution (October, 2009):

Change 9.12.4 [dcl.attr.depend] paragraph 1 as follows:

...The attribute applies to the declarator-id of a parameter-declaration in a function declaration or lambda, in which case it specifies that the initialization of the parameter carries a dependency to (6.9.2 [intro.multithread]) each lvalue-to-rvalue conversion (7.3.2 [conv.lval]) of that object. The attribute also applies to the declarator-id of a function declaration, in which case it specifies that the return value, if any, carries a dependency to the evaluation of the function call expression.