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

2024-11-11


1867. Function/expression ambiguity with qualified parameter name

Section: 9.3.3  [dcl.ambig.res]     Status: NAD     Submitter: Richard Smith     Date: 2014-02-12

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.

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.