1 // header for codegen-extern-template.cpp
2 #ifndef CODEGEN_EXTERN_TEMPLATE_H
3 #define CODEGEN_EXTERN_TEMPLATE_H
4 
5 template <typename T>
foo()6 inline T foo() { return 10; }
7 
8 extern template int foo<int>();
9 
bar()10 inline int bar() { return foo<int>(); }
11 
12 #endif
13