https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99610
Bug ID: 99610 Summary: GCC thinks member function template is a deduction guide Product: gcc Version: 8.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcchelp.5.adept at 0sg dot net Target Milestone: --- When compiling with -std=c++17 or -std=gnu++17, the following errors are reported for the code below: [2] error: return type specified for deduction guide [2] error: decl-specifier in declaration of deduction guide [2] error: 'signed' or 'unsigned' invalid for '__dguide_Hash' [2] error: deduction guide for 'Hash<K, V, C>' must have trailing return type [1] note: 'template<class K, class V, class C> class Hash' declared here The same code is accepted without errors by clang and msvc 2019. I'm not sufficiently versed in the c++ standard to tell if this is on the compiler or not. Thanks! ---------------------- [1] template< typename K, typename V, typename C = HashContext<K> > class Hash { // ... }; template< typename K > class HashContext { public: template< typename X > [2] unsigned Hash( const X &arg ) const { ... } };