1// PR c++/50372 2// Test that a template instantiation has the same linkage as its argument. 3// { dg-final { scan-assembler "(weak|glob)\[^\n\]*_Z3fooIXadL_Z13external_funcvEEEvv" } } 4// { dg-final { scan-assembler-not "(weak|glob)\[^\n\]*_Z3fooIXadL_ZL11static_funcvEEEvv" { xfail powerpc-*-aix* } } } 5 6template<void (*fptr)(void)> 7void foo() { } 8 9static void static_func() {} 10void external_func() { } 11 12void test() 13{ 14#if __cplusplus > 199711L 15 foo<&static_func>(); 16#endif 17 foo<&external_func>(); 18} 19