[Bug c++/77615] Template specialization is resolved differently with and without optimizations turned on
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 16 10:22:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77615
--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
The compiler only sees single compilation units and it doesn't keep
a database of previously seen units.
When it compiles usage.cc it doesn't know anything about specialization.cc.
So there really is nothing that the compiler could do here.
And clang and other compilers also don't warn and behave exactly like
gcc once you use -O2.
More information about the Gcc-bugs
mailing list