[Bug c++/80438] Variadic template class argument deduction failure from variadic constructor deduction guide

2024-04-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80438

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |10.2

--- Comment #3 from Andrew Pinski  ---
Most likely fixed by r11-1571-g57b4daf8dc4ed7b6. (which was backported to GCC
10.2.0 also).

[Bug c++/80438] Variadic template class argument deduction failure from variadic constructor deduction guide

2019-02-18 Thread ed at catmur dot uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80438

Ed Catmur  changed:

   What|Removed |Added

 CC||ed at catmur dot uk

--- Comment #2 from Ed Catmur  ---
Workaround: add an N=1+ deduction guide:

// existing
template 
foo(Us...) -> foo;
// additional, for g++
template 
foo(U, Us...) -> foo;

[Bug c++/80438] Variadic template class argument deduction failure from variadic constructor deduction guide

2018-12-26 Thread TonyELewis at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80438

Tony E Lewis  changed:

   What|Removed |Added

 CC||TonyELewis at hotmail dot com

--- Comment #1 from Tony E Lewis  ---
Here are the notes I wrote before I spotted I was about to file a duplicate of
Vittorio's report...


[C++17] constructor unexpectedly preferred over deduction guide in CTAD

Compiling the following under `-std=c++17` :


#include 

template 
struct x {
template  x(const Ts &...) {}
};

template  x(const Ts &...) -> x;

static_assert(   std::is_same_v< decltype( x{ 0 } ), x > );
static_assert( ! std::is_same_v< decltype( x{ 0 } ), x<   > > );


...I see the two static_assert statements failing under GCC, implying that `x{
0 }` is of type `x<>`, rather than `x` as I would expect. These two
static_assert statements pass under Clang.


I would expect `x` because I would expect the deduction guide to take
precedence over the constructor in determining the type of the expression `x{ 0
}`. AFAIU, this is what's meant by the point in [over.match.best] in the
standard that says F1 is "better" than F2 if: 

> [...] F1 is generated from a deduction-guide [...] and F2 is not [...]

(from C++17 draft n4659.pdf and from working draft
http://eel.is/c++draft/over.match.best )

I'm seeing this on the current trunk build of GCC on Godbolt (g++ 9.0.0
20181225 (experimental)).

[Bug c++/80438] Variadic template class argument deduction failure from variadic constructor deduction guide

2018-11-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80438

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-11-14
 Ever confirmed|0   |1