https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83417
Bug ID: 83417 Summary: Pointer-to-member template parameter with auto member type dependent container type does not work (C++17) Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ambrop7 at gmail dot com Target Milestone: --- The following C++17 program does not compile with GCC 7.2.0 but does with Clang 5.0.0: template <typename T, auto T::*M> void f() {} struct A { int x; }; int main() { f<A, &A::x>(); return 0; } The error is: test.cpp: In function ‘int main()’: test.cpp:4:17: error: no matching function for call to ‘f<A, &A::x>()’ f<A, &A::x>(); ^ test.cpp:1:40: note: candidate: template<class T, auto T::* M> void f() template <typename T, auto T::*M> void f() {} ^ test.cpp:1:40: note: template argument deduction/substitution failed: test.cpp:4:17: error: unable to deduce ‘auto T::*’ from ‘&A::x’ f<A, &A::x>(); ^ test.cpp:4:17: note: mismatched types ‘T’ and ‘A’