This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54890] New: Incorrect SFINAE Rejection
- From: "pmenso57 at comcast dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Oct 2012 15:19:11 +0000
- Subject: [Bug c++/54890] New: Incorrect SFINAE Rejection
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54890
Bug #: 54890
Summary: Incorrect SFINAE Rejection
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pmenso57@comcast.net
When explicitly specifying the template parameters to a function template in
the following context, the compiler incorrectly removes the function from the
overload set for a substitution failure which should not exist.
struct A {
template<class T> struct apply { };
};
template<class T, class... U>
void f(typename T::template apply<U...>*) { }
int main() {
f<A, int>(nullptr);
return 0;
}
Output from the compiler is:
In function âint main()â:
error: no matching function for call to âf(std::nullptr_t)â
note: candidate is:
note: template<class T, class ... U> void f(typename T::apply<U ...>*)
note: template argument deduction/substitution failed:
note: mismatched types âA::apply<U ...>*â and âstd::nullptr_tâ
Which I believe is incorrect.