$ clang++ hello.cc src1.cpp src2.cpp ; ./a.out src1 Test src1 Test
Note the msg for f2 is incorrect. A simple fix is to place the struct inside the function, so that both struct
have internal linkage. For example for src1.cpp:
$ clang++ hello.cc src1.cpp src2.cpp ; ./a.out src1 Test src2 Test
This kind of bug is subtle and it has its counterpart in C as well – functions defined at top-level have external
linkage. The quick fix in C is to mark them as static.