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

Arseny Solokha <asolokha at gmx dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asolokha at gmx dot com

--- Comment #2 from Arseny Solokha <asolokha at gmx dot com> ---
g++-10.0.1-alpha20200412 snapshot (g:87be4cecfc6e42390303be1ca92bc8bc587b0bd6)
and g++ 9.3 both don't crash, rejecting it instead:

% g++-10.0.1 -c pr91538.C   
pr91538.C: In function 'void f()':
pr91538.C:3:8: error: no match for call to '(f()::<lambda(auto:1 ..., decltype
(args)...)>) (int)'
    3 |     l(0);
      |        ^
pr91538.C:2:14: note: candidate: 'f()::<lambda(auto:1 ..., decltype (args)...)>
[with auto:1 = {}]'
    2 |     auto l = [](auto... args, decltype(args)...){};
      |              ^
pr91538.C:2:14: note:   candidate expects 0 arguments, 1 provided

as do clang++ 9 and 10:

% clang++-10 -c pr91538.C 
pr91538.C:3:5: error: no matching function for call to object of type '(lambda
at pr91538.C:2:14)'
    l(0);
    ^
pr91538.C:2:14: note: candidate function [with args:auto = <>] not viable:
requires 0 arguments, but 1 was provided
    auto l = [](auto... args, decltype(args)...){};
             ^
1 error generated.

So it looks like this PR is really ice-on-invalid-code for gcc 8?

Reply via email to