Title
Nonsensical disambiguation rule
Status
c++23
Section
9.3.3 [dcl.ambig.res]
Submitter
Krystian Stasiowski

Created on 2019-04-18.00:00:00 last changed 9 months ago

Messages

Date: 2022-09-24.20:21:59

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 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 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.
Date: 2022-09-24.20:21:59

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], the The resolution is to consider any construct that could possibly be a function declaration a function declaration.
Date: 2022-11-15.00:00:00

[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:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: drwp -> open
2023-02-18 18:43:04adminsetstatus: dr -> drwp
2022-11-25 05:14:04adminsetstatus: ready -> dr
2022-09-24 20:21:59adminsetmessages: + msg6944
2022-09-09 20:22:05adminsetstatus: open -> ready
2022-08-30 07:34:15adminsetmessages: + msg6917
2019-04-18 00:00:00admincreate