[Bug c++/56328] Explicit instantiation of inline function template works for base template, fails for specialized template
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 14 20:40:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56328
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-02-14 20:39:53 UTC ---
The foo<2> specialization is not declared in main.cpp before it would be
needed, so the program is ill-formed, no diagnostic required, according to
[templ.expl.spec]/6.
Also, the following paragraph is relevant:
"When writing a specialization, be careful about its location, or to make it
compile will be such a trial as to kindle its self-immolation."
More information about the Gcc-bugs
mailing list