On 1/7/19 6:56 PM, Marek Polacek wrote:
At the risk of seeming overly eager, I thought it would be reasonable to
go with the following: enabling braced-init-list as a template-argument.
As the discussion on the reflector clearly indicates, this was the intent
from the get-go.

I know, it's not a regression.  But I restricted the change to C++20, and it
should strictly allow code that wasn't accepted before -- when a template
argument starts with {.  Perhaps we could even drop the C++20 check.

What's your preference?

Let's keep the C++20 check for now at least. I'd suggest moving the change further down, with this code:

  if (cxx_dialect <= cxx14)
    argument = cp_parser_constant_expression (parser);
  else
    {
/* With C++17 generalized non-type template arguments we need to handle lvalue constant expressions, too. */
      argument = cp_parser_assignment_expression (parser);
      require_potential_constant_expression (argument);
    }

Jason

Reply via email to