[Bug c++/86932] [8/9 Regression] Empty non-type template parameter pack not considered for SFINAE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86932 --- Comment #4 from Jason Merrill --- Author: jason Date: Wed Mar 27 14:27:00 2019 New Revision: 269965 URL: https://gcc.gnu.org/viewcvs?rev=269965=gcc=rev Log: PR c++/86932 - missed SFINAE with empty pack. The issue here was that when processing the explicit template args in fn_type_unification we added an empty argument pack for the parameter pack, so we never tried to do any deduction for it, and therefore never looked at its type. We need that empty pack behavior for partial ordering, but we don't want it here, so let's make it conditional on tf_partial. * pt.c (coerce_template_parms): Don't add an empty pack if tf_partial. (fn_type_unification): Pass tf_partial to coerce_template_parms. Added: trunk/gcc/testsuite/g++.dg/cpp0x/sfinae65.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c
[Bug c++/86932] [8/9 Regression] Empty non-type template parameter pack not considered for SFINAE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86932 Jason Merrill changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
[Bug c++/86932] [8/9 Regression] Empty non-type template parameter pack not considered for SFINAE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86932 Jakub Jelinek changed: What|Removed |Added Target Milestone|8.3 |8.4 --- Comment #3 from Jakub Jelinek --- GCC 8.3 has been released.
[Bug c++/86932] [8/9 Regression] Empty non-type template parameter pack not considered for SFINAE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86932 Richard Biener changed: What|Removed |Added Priority|P3 |P2
[Bug c++/86932] [8/9 Regression] Empty non-type template parameter pack not considered for SFINAE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86932 Richard Biener changed: What|Removed |Added Target Milestone|--- |8.3
[Bug c++/86932] [8/9 Regression] Empty non-type template parameter pack not considered for SFINAE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86932 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Known to work||7.3.0 Keywords||accepts-invalid Last reconfirmed||2018-08-13 CC||jason at gcc dot gnu.org Ever confirmed|0 |1 Summary|[8 Regression] Empty|[8/9 Regression] Empty |non-type template parameter |non-type template parameter |pack not considered for |pack not considered for |SFINAE. |SFINAE. Known to fail||8.2.0, 9.0 --- Comment #2 from Jonathan Wakely --- You've got a stray 'typename' there. Reduced: template struct enable_if { using type = T; }; template struct enable_if { }; template struct is_foo { static constexpr bool value = false; }; template::value, int>::type...> void f() {} int main() { f(); } Started to be accepted with r247842 PR c++/79549 - C++17 ICE with non-type auto template parameter pack * pt.c (convert_template_argument): Just return an argument pack. (coerce_template_parameter_pack, template_parm_to_arg) (extract_fnparm_pack, make_argument_pack, tsubst_template_args) (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion): Don't set the type of a NONTYPE_ARGUMENT_PACK. * parser.c (make_char_string_pack, make_string_pack): Likewise.