Does static object in a template function have linkage?
问题 This question refers to my previous question: clang does not compile my code, but g++ does. From my research, the issue at stake boils down to linkage, does the static variable data have linkage in the sample below (it compiles with g++-4.8.1 )? How come it has linkage (I would not otherwise be able to instantiate with a non-type template parameter)? template <int const* ptr> void foo() { } typedef void (*func_type)(); template <int = 0> void run_me() { static int data; func_type const f1 =