Fix issue on clang about implicit instantiation of undefined template

Generated code does not include <string>, which is referenced in templates.
Clang may be incorrectly or aggresively instantiating some template.

E.g.,
import_stl_b_wrap.cxx:3199:51: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>
This commit is contained in:
Marvin Greenberg 2014-02-03 11:34:55 -05:00
commit 213774e0b6
2 changed files with 14 additions and 2 deletions

View file

@ -73,7 +73,13 @@ namespace std {
#endif
%}
%fragment("StdTraitsCommon","header") %{
%fragment("StdStringInclude","header") %{
#ifdef __clang__
#include <string>
#endif
%}
%fragment("StdTraitsCommon","header",fragment="StdStringInclude") %{
namespace swig {
template <class Type>
struct noconst_traits {