Title
Function/expression ambiguity with qualified parameter name
Status
nad
Section
9.3.3 [dcl.ambig.res]
Submitter
Richard Smith

Created on 2014-02-12.00:00:00 last changed 119 months ago

Messages

Date: 2014-06-15.00:00:00

Rationale (June, 2014):

CWG noted that the grammar change to allow disambiguation based on the parameter name being qualified is large, so the cost outweighs the relatively small benefit for disambiguating this particular corner case.

Date: 2022-11-20.07:54:16

In an example like,

  namespace N { enum E { X }; }
  struct S { S(N::E); };
  S s(S(N::X));

the last line disambiguates as an (ill-formed) function declaration, because the restriction requiring unqualified parameter names is semantic, not syntactic. Should the language be changed to use the presence of a qualified-id in this case as disambiguation? There is implementation divergence in the handling of this example.

History
Date User Action Args
2014-07-07 00:00:00adminsetmessages: + msg5114
2014-07-07 00:00:00adminsetstatus: open -> nad
2014-02-12 00:00:00admincreate