Take: struct foo { private: template<typename U> static bool func(const U& x) {} static bool func1(const int& x) {} public: unsigned int Find(const int& x, bool (*pFunc) (const int&) = func) const {} unsigned int Find1(const int& x, bool (*pFunc) (const int&) = func1) const {} };
foo b; void f(void) { b.Find1(1); b.Find(1); } --- CUT --- Only the call to Find is rejected with the following error message: t.cc: In function void f(): t.cc:5: error: static bool foo::func(const U&) [with U = int] is private t.cc:16: error: within this context This is wrong as func is not private in the default argument. -- Summary: [4.3/4.4 Regression] Rejects default argument that is a template Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37971