This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56328] Explicit instantiation of inline function template works for base template, fails for specialized template
- From: "michael.schlottke at sloede dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Feb 2013 08:02:07 +0000
- Subject: [Bug c++/56328] Explicit instantiation of inline function template works for base template, fails for specialized template
- Auto-submitted: auto-generated
- References: <bug-56328-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56328
--- Comment #4 from Michael Schlottke <michael.schlottke at sloede dot com> 2013-02-15 08:02:07 UTC ---
(In reply to comment #2)
> 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.
If I declare the foo<2> specialization in main.cpp, it does not change
anything.
> 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."
I think this does not apply here (does it?), as it doesn't work even if I
declare foo<2> in both files after the base template.