This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50560] g++ optimization -O3 is removing symbols from templates
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Sep 2011 18:37:37 +0000
- Subject: [Bug c++/50560] g++ optimization -O3 is removing symbols from templates
- Auto-submitted: auto-generated
- References: <bug-50560-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50560
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-28 18:37:37 UTC ---
your hack to allow "separately compiled template components" isn't valid C++,
but you can make the code valid by putting an explicit instantiation
declaration in the header:
extern template class Option<std::string>;
and an explicit instantiation definition in bug_Option.cpp (after all the
members have been defined)
template class Option<std::string>;