// { dg-do assemble } // Submitted by Erez Louidor Lior template class H; template H foo(const H&); template class H{ #ifdef OK public: #endif template class Caster, typename Source> static H cast(const H& s); #ifndef OK template friend H foo(const H&); #endif }; template class caster; template H foo(const H& s){ return H::template cast(s); } int main(){ H i; foo(i); }