mirror of https://github.com/swig/swig
Correct instantiate of std::basic_istream and std::basic_ostream
Instantiate them correctly before they are used as member variables to
fix regression in e07957ad4c
.
std::cin is read-only! ...
checking python testcase li_std_string_extra (with run test)
In file included from /usr/include/c++/9/ios:44,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from li_std_stream_wrap.cxx:3278:
/usr/include/c++/9/bits/basic_ios.h: In member function ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)’:
/usr/include/c++/9/bits/basic_ios.h:67:11: error: ‘std::ios_base& std::ios_base::operator=(const std::ios_base&)’ is private within this context
67 | class basic_ios : public ios_base
| ^~~~~~~~~
In file included from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from li_std_stream_wrap.cxx:3278:
/usr/include/c++/9/bits/ios_base.h:870:5: note: declared private here
870 | operator=(const ios_base&);
| ^~~~~~~~
In file included from /usr/include/c++/9/iostream:40,
from li_std_stream_wrap.cxx:3278:
/usr/include/c++/9/istream: In member function ‘std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)’:
/usr/include/c++/9/istream:58:11: note: synthesized method ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)’ first required here
58 | class basic_istream : virtual public basic_ios<_CharT, _Traits>
| ^~~~~~~~~~~~~
li_std_stream_wrap.cxx: In function ‘int Swig_var_cin_set(PyObject*)’:
li_std_stream_wrap.cxx:13992:19: note: synthesized method ‘std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)’ first required here
13992 | std::cin = *temp;
This commit is contained in:
parent
275764c7bb
commit
4f337d6495
|
@ -264,6 +264,14 @@ namespace std
|
|||
seekg(off_type, ios_base::seekdir);
|
||||
};
|
||||
|
||||
%template(ostream) basic_ostream<char>;
|
||||
%template(istream) basic_istream<char>;
|
||||
|
||||
#if defined(SWIG_WCHAR)
|
||||
%template(wostream) basic_ostream<wchar_t>;
|
||||
%template(wistream) basic_istream<wchar_t>;
|
||||
#endif
|
||||
|
||||
// 27.6.1.5 Template class basic_iostream
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_iostream
|
||||
|
@ -318,8 +326,6 @@ namespace std
|
|||
}
|
||||
|
||||
namespace std {
|
||||
%template(ostream) basic_ostream<char>;
|
||||
%template(istream) basic_istream<char>;
|
||||
%template(iostream) basic_iostream<char>;
|
||||
|
||||
%template(endl) endl<char, std::char_traits<char> >;
|
||||
|
@ -327,8 +333,6 @@ namespace std {
|
|||
%template(flush) flush<char, std::char_traits<char> >;
|
||||
|
||||
#if defined(SWIG_WCHAR)
|
||||
%template(wostream) basic_ostream<wchar_t>;
|
||||
%template(wistream) basic_istream<wchar_t>;
|
||||
%template(wiostream) basic_iostream<wchar_t>;
|
||||
|
||||
%template(wendl) endl<wchar_t, std::char_traits<wchar_t> >;
|
||||
|
|
Loading…
Reference in New Issue