This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56328] Explicit instantiation of inline function template works for base template, fails for specialized template


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]