This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54890] New: Incorrect SFINAE Rejection


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]