http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48594
Summary: [4.3/4.4/4.5/4.6/4.7] Rejects valid with pointer-to-member in template Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ja...@gcc.gnu.org CC: ja...@gcc.gnu.org https://bugzilla.redhat.com/show_bug.cgi?id=695567 struct A { } a; typedef void (*pfn)(); pfn operator->* (A, int); template <class T> void f() { (a->*1)(); } used to be accepted in 3.2/3.3, 3.4 and above errors out. Or: #include <vector> #include <boost/spirit/include/phoenix.hpp> namespace ph = boost::phoenix; struct Triangle {}; extern ph::actor<ph::value<std::vector<Triangle> *> > vp; #ifndef WORKS template<typename T> #endif void foo () { void (std::vector<Triangle>::*const p)(const Triangle&) = &std::vector<Triangle>::push_back; Triangle tria1; (vp->*p)(tria1); } #ifndef WORKS void bar () { foo<int> (); } #endif (preprocessed source in https://bugzilla.redhat.com/attachment.cgi?id=491460 ) errors out similarly, with different error, if not in template, it is accepted.