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

2013-12-11 Thread akela1101 at gmail dot com
Severity: major Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: akela1101 at gmail dot com Different behaviour with -O1 and without. In first case g++ doesn't see template instantiation in .cpp and uses default. In second case it

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

2013-12-11 Thread akela1101 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59475 --- Comment #1 from Akela1101 --- Created attachment 31421 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31421&action=edit ii, source, sh script

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

2013-12-11 Thread akela1101 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59475 --- Comment #3 from Akela1101 --- Thank you. But could you explain in more detail, why results of this little program are different depending on -O1 flag? I thought they both should be 0. Or am I wrong?

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

2013-12-12 Thread akela1101 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59475 --- Comment #5 from Akela1101 --- 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 func