[Bug c++/83542] template deduction failure when using pack in both deduced and non-deduced contexts

2018-02-16 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83542

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-17
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1
  Known to fail||7.3.0, 8.0

--- Comment #2 from Martin Sebor  ---
Confirmed with 8.0.  Both Clang and ICC compile the code.

[Bug c++/83542] template deduction failure when using pack in both deduced and non-deduced contexts

2017-12-21 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83542

--- Comment #1 from Barry Revzin  ---
This slightly different example:

template 
struct list { };

template 
void foo(list, list, void(*)(T..., U)) 
{ }


void f(int, int) { } 

int main()
{
foo(list{}, list{}, &f);
}


fails with a different error:

foo.cxx: In function ‘int main()’:
foo.cxx:13:37: error: no matching function for call to ‘foo(list,
list, void (*)(int, int))’
 foo(list{}, list{}, &f);
 ^
foo.cxx:5:6: note: candidate: template void foo(list, list, void (*)(T ..., U))
 void foo(list, list, void(*)(T..., U))
  ^~~
foo.cxx:5:6: note:   template argument deduction/substitution failed:
foo.cxx:13:37: note:   candidate expects 1 argument, 2 provided
 foo(list{}, list{}, &f);
 ^

[Bug c++/83542] template deduction failure when using pack in both deduced and non-deduced contexts

2021-08-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83542

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2018-02-17 00:00:00 |2021-8-23

--- Comment #3 from Andrew Pinski  ---
clang started to reject it in 7:
:14:5: error: no matching function for call to 'foo'
foo(list{}, list{}, &f);
^~~
:6:6: note: candidate template ignored: deduced packs of different
lengths for parameter 'T' ( vs. <>)
void foo(list, list, void(*)(T..., U...))
 ^

MSVC also rejects it:

(14): error C2672: 'foo': no matching overloaded function found
(14): error C2784: 'void foo(list,list,void (__cdecl
*)(T...,U...))': could not deduce template argument for 'void (__cdecl
*)(T...,U...)' from 'void (__cdecl *)(int,int)'
(6): note: see declaration of 'foo'