[Bug c++/59475] gcc with flag -O1 fails to find template specialization when there is default one.

akela1101 at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Dec 12 11:29:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59475

--- Comment #5 from Akela1101 <akela1101 at gmail dot com> ---
I see...
So, at -O1 in main.o the function is inline, and in A.o it has outer
implementation. At -O0 in both TU, not inline function is using.

The thing was not template specialization, but processing inline functions.
Sorry, I didn't know linker even had no warnings like "multiple definition" for
inline functions, e.g.:

TU 1:
int foo() { return 1; }
TU 2:
inline int foo() { return 2; }



More information about the Gcc-bugs mailing list