// Build don't link: // Templates defined outside must be declared inside // crash test - XFAIL *-*-* namespace bar { template void foo(); // trick it to provide some prior declaration templateclass X; // ERROR - previous declaration } template T const bar::foo(T const &a) { // ERROR - not declared in bar - XFAIL *-*-* return a; } template<> void bar::foo() { // ERROR - not declared in bar - XFAIL *-*-* } template class bar::X{}; // ERROR - does not match declaration