Created on 2019-04-18.00:00:00 last changed 16 months ago
Proposed resolution (approved by CWG 2022-09-23):
Change in 9.3.3 [dcl.ambig.res] paragraph 1 as follows:
The ambiguity arising from the similarity between a function-style cast and a declaration mentioned in 8.9 [stmt.ambig] can also occur in the context of a declaration. In that context, the choice is betweena function declaration with a redundant set of parentheses around a parameter name andan object declaration with a function-style cast as the initializer and a declaration involving a function declarator with a redundant set of parentheses around a parameter name. Just as for the ambiguities mentioned in 8.9 [stmt.ambig], the resolution is to consider any construct, such as the potential parameter declaration, that could possibly be a declaration to be a declaration.
Proposed resolution (2022-09-09) [SUPERSEDED]:
Change in 9.3.3 [dcl.ambig.res] paragraph 1 as follows:
...Just as for the ambiguities mentioned in 8.9 [stmt.ambig], theThe resolution is to consider any construct that could possibly be a function declaration a function declaration.
[Accepted as a DR at the November, 2022 meeting.]
Subclause 9.3.3 [dcl.ambig.res] paragraph 1 specifies:
The ambiguity arising from the similarity between a function-style cast and a declaration mentioned in 8.9 [stmt.ambig] can also occur in the context of a declaration. In that context, the choice is between a function declaration with a redundant set of parentheses around a parameter name and an object declaration with a function-style cast as the initializer. Just as for the ambiguities mentioned in 8.9 [stmt.ambig], the resolution is to consider any construct that could possibly be a declaration a declaration.
The specification correctly describes an ambiguity between a function declaration and an object declaration, but resolves the ambiguity to a "declaration", which does not offer any insight.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: drwp -> open |
2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
2022-11-25 05:14:04 | admin | set | status: ready -> dr |
2022-09-24 20:21:59 | admin | set | messages: + msg6944 |
2022-09-09 20:22:05 | admin | set | status: open -> ready |
2022-08-30 07:34:15 | admin | set | messages: + msg6917 |
2019-04-18 00:00:00 | admin | create |