http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57550
Bug ID: 57550 Summary: [4.8/4.9] Regression: bogus "error ... is private" Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Google ref: b/9321660 Current trunk (r199768) fails to compile this test when ACCESS is private: g++ -c proto1.xx.cc -Wall -DACCESS=public && echo OK OK g++ -c proto1.xx.cc -Wall -DACCESS=private proto1.xx.cc: In instantiation of ‘static void Handler::SetPrimitiveHandlers() [with T = double]’: proto1.xx.cc:15:53: required from here proto1.xx.cc:9:36: error: no matching function for call to ‘MakeHandler(<unresolved overloaded function type>)’ MakeHandler(Wrapper<Append<T> >); ^ proto1.xx.cc:9:36: note: candidate is: proto1.xx.cc:2:25: note: template<class T> void MakeHandler(bool (*)(T)) template <class T> void MakeHandler (bool (T)); ^ proto1.xx.cc:2:25: note: template argument deduction/substitution failed: proto1.xx.cc:12:37: error: ‘static bool Handler::Append(T) [with T = double]’ is private template <typename T> static bool Append (T); ^ proto1.xx.cc:9:36: error: within this context MakeHandler(Wrapper<Append<T> >); ^ /// --- cut --- template <bool (double)> bool Wrapper(double); template <class T> void MakeHandler(bool (T)); class Handler { public: template <typename T> static void SetPrimitiveHandlers() { MakeHandler(Wrapper<Append<T> >); } ACCESS : template <typename T> static bool Append(T); }; template void Handler::SetPrimitiveHandlers<double>(); /// --- cut ---