[Bug c++/50560] g++ optimization -O3 is removing symbols from templates
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 28 19:20:00 GMT 2011
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>;
More information about the Gcc-bugs
mailing list