Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 4.9 support #27

Open
Manu343726 opened this issue Mar 14, 2018 · 1 comment
Open

GCC 4.9 support #27

Manu343726 opened this issue Mar 14, 2018 · 1 comment

Comments

@Manu343726
Copy link

Manu343726 commented Mar 14, 2018

With GCC 4.9.3 (debian linux) I get compilation errors related to the lack of copy constructor in std::stringstream:

Scanning dependencies of target di
In file included from /home/manuel-sanchez/Documentos/iod/tests/../iod/json.hh:15:0,
                 from /home/manuel-sanchez/Documentos/iod/tests/deep_merge.cc:4:
/home/manuel-sanchez/Documentos/iod/tests/../iod/json_unicode.hh: In function ‘decltype(auto) iod::wrap_json_input_stream(const iod::stringview&)’:
/home/manuel-sanchez/Documentos/iod/tests/../iod/json_unicode.hh:64:96: error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&)’
   wrap_json_input_stream(const iod::stringview& s) { return std::stringstream(s.to_std_string()); }
                                                                                                ^
In file included from /home/manuel-sanchez/Documentos/iod/tests/../iod/json.hh:9:0,
                 from /home/manuel-sanchez/Documentos/iod/tests/deep_merge.cc:4:
/usr/include/c++/4.9/sstream:502:11: note: ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_stringstream : public basic_iostream<_CharT, _Traits>
           ^
/usr/include/c++/4.9/sstream:502:11: error: use of deleted function ‘std::basic_iostream<char>::basic_iostream(const std::basic_iostream<char>&)’
In file included from /usr/include/c++/4.9/iostream:40:0,
                 from /home/manuel-sanchez/Documentos/iod/tests/deep_merge.cc:1:
/usr/include/c++/4.9/istream:795:11: note: ‘std::basic_iostream<char>::basic_iostream(const std::basic_iostream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_iostream
           ^

What I can say from the output is that it seems that for some reason that function is not triggering RVO and the stdlibc++ stream has no move constructor (So the compiler picks the copy ctor instead).

UPDATE: After adding gcc 4.9 to the build matrix I see that the "issue" is just that the library no longer supports GCC 4.9 in its current form.

Do you have plans to maintain compatibility with GCC 4.9?

@Manu343726 Manu343726 changed the title std::istringstream copy? std::stringstream copy? Mar 14, 2018
@Manu343726 Manu343726 changed the title std::stringstream copy? GCC 4.9 support Mar 14, 2018
@matt-42
Copy link
Owner

matt-42 commented Mar 20, 2018

It depends on the work it requires,. Could you make it compile on gcc 4.9 already ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants