Hi, I think I've found a bug in g++. Let's say we have following files:
// a.hpp template<typename T> void func1() { // general code } // a.cpp #include "a.hpp" template<> void func1<int>() { // specialized code } // main.cpp #include "a.hpp" int main(void) { func1<int>(); return 0; } Now when we run the program compiled with: g++ main.cpp a.cpp -o main specialized version of func1 will be called, but when compiled with -Os flag the general version will be called. I'm not an expert but I believe the -Os behaviour is the correct one. Please CC me when replying, as I'm not subscribed to the mailing list. Regards, Maciej Cencora