https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103401

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This is trickier than it seemed.

void f(decltype(auto(0))) { }
is actually valid in C++23 (probably) since auto(x) is supported.  So I think
it's essentially like
void f(int) { }

The r11-1913 change is OK: we need to make sure that we see '(auto)' after
decltype to go ahead with 'decltype(auto)'.

I think we shouldn't be calling synthesize_implicit_template_parm for auto(x)
in a parameter-list.

More tests:

void f1 (decltype(auto(0)));
void f2 (decltype(auto{0}));
void f3 (int = auto(42));
void f4 (int = auto{42});
void f5 (decltype(auto(0)) = auto(42));
// Careful about just checking ( after auto:
void f6 (auto (x));

Reply via email to