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++/50560] g++ optimization -O3 is removing symbols from templates


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>;


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