stlport/stl/_locale.h includes stl/_string_fwd.h, which contains forward declaration of std::basic_string template, and instantiates it at line 155, which is not allowed in C++. clang detects this situation and generates compilation error. For unknown reason gcc passes this. Reproducible: Always Steps to Reproduce: 1. echo "#include <iostream>">main.cpp 2. clang++ -c main.cpp -isystem/usr/include/stlport Actual Results: Successful compilation Expected Results: Error occurs: In file included from main.cpp:1: In file included from /usr/include/stlport/iostream:43: In file included from /usr/include/stlport/stl/_istream.h:27: In file included from /usr/include/stlport/stl/_ios.h:23: In file included from /usr/include/stlport/stl/_ios_base.h:30: /usr/include/stlport/stl/_locale.h:155:39: error: implicit instantiation of undefined template 'stlp_std::basic_string<char, stlp_std::char_traits<char>, stlp_std::allocator<char> >' _M_throw_on_combine_error(__loc.name()); ^ /usr/include/stlport/stl/_string_fwd.h:32:7: note: template is declared here class basic_string; ^ 1 error generated.
Created attachment 299695 [details, diff] patch that fixes the issue by including header with complete std::basic_string definition
This issue has been reported in August 2011, but STLport maintainer was in bad mood and rejected bug report without issue investigation: http://sourceforge.net/tracker/?func=detail&aid=3400141&group_id=146814&atid=766244
I do get at a ~amd64: x86_64-pc-linux-gnu-g++ -pthread -fexceptions -fPIC -fvisibility=hidden -O2 -pipe -D_GNU_SOURCE -I../../stlport -c -o obj/gcc/so/time_facets.o ../../src/time_facets.cpp ../../src/time_facets.cpp: In function ‘void stlp_std::priv::__write_formatted_timeT(stlp_std::priv::__basic_iostring<_CharT>&, const stlp_std::ctype<_CharT>&, char, char, const _TimeInfo&, const tm*)’: ../../src/time_facets.cpp:434:19: error: ‘const struct tm’ has no member named ‘__tm_gmtoff’ diff = t->__tm_gmtoff; ^ ../Makefiles/gmake/targets.mak:123: recipe for target 'obj/gcc/so/time_facets.o' failed make[1]: *** [obj/gcc/so/time_facets.o] Error 1 make[1]: Leaving directory '/var/tmp/portage/dev-libs/STLport-5.2.1-r2/work/STLport-5.2.1/build/lib' Makefile:15: recipe for target 'all' failed make: *** [all] Error 2 * ERROR: dev-libs/STLport-5.2.1-r2::gentoo failed (compile phase): * emake failed
Masked for removal. commit 101473c8fcfd29edec481993247d3e5dac60d8b0 Author: David Seifert <soap@gentoo.org> Date: Wed Apr 5 19:14:18 2017 +0200 profiles: Mask dev-libs/STLport for removal Bug: https://bugs.gentoo.org/show_bug.cgi?id=359247 Bug: https://bugs.gentoo.org/show_bug.cgi?id=400547 Bug: https://bugs.gentoo.org/show_bug.cgi?id=409119 Bug: https://bugs.gentoo.org/show_bug.cgi?id=594144
commit 967d0ecf3f118dae84b7d100d3464f26cc3d33f7 Author: David Seifert <soap@gentoo.org> Date: Sun May 7 09:47:53 2017 +0200 dev-libs/STLport: Remove from tree