[Bug c++/83181] [C++17] Invalid deduction guide accepted
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83181 Eddie Nolan changed: What|Removed |Added CC||eddiejnolan at gmail dot com --- Comment #3 from Eddie Nolan --- Here's another example: template struct foo {}; template foo(T&&) -> foo; Clang says: :5:1: error: deduction guide template contains a template parameter that cannot be deduced 5 | foo(T&&) -> foo; | ^ :4:31: note: non-deducible template parameter 'U' 4 | template | ^ But GCC accepts it.
[Bug c++/83181] [C++17] Invalid deduction guide accepted
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83181 Marek Polacek changed: What|Removed |Added Last reconfirmed||2020-09-16 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC||mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek --- Still accepted.
[Bug c++/83181] [C++17] Invalid deduction guide accepted
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83181 TC changed: What|Removed |Added CC||rs2740 at gmail dot com --- Comment #1 from TC --- What's happening here is that a deduction failure occurs with the deduction guide (substitution yields a template non-type parameter of type void whose argument also can't be deduced) and so it is eliminated from the overload set, but there's still an implicit guide generated from the constructor and the deduction is done from that. [temp.param]/15 proscribes deduction guide templates with a template parameter that neither is deducible nor has a default argument, so this should be diagnosed.