Opened 14 years ago

Closed 14 years ago

#2381 closed Bugs (fixed)

[interprocess] invalid use of incomplete type std::istream

Reported by: Farid Zaripov <faridz@…> Owned by: Ion Gaztañaga
Milestone: Boost 1.37.0 Component: interprocess
Version: Boost Development Trunk Severity: Showstopper
Keywords: Cc:

Description

From this log:

    "g++"  -ftemplate-depth-128 -O0 -fno-inline -Wall -g -m64 -march=nocona -pthread -fPIC -nostdinc++ -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -D_RWSTDDEBUG  -I".." -I"/var/tmp/stdcxx/4.2.x/gcc/15D/include" -I"/var/tmp/stdcxx/4.2.x/include" -I"/var/tmp/stdcxx/4.2.x/include/ansi" -c -o "/var/tmp/boost/results/boost/bin.v2/libs/interprocess/test/vectorstream_test.test/gcc-4.3.0_stdcxx_422/debug/address-model-64/architecture-x86/instruction-set-nocona/stdlib-stdcxx-4.2.2/threading-multi/vectorstream_test.o" "../libs/interprocess/test/vectorstream_test.cpp"

In file included from ../libs/interprocess/test/vectorstream_test.cpp:12:
../boost/interprocess/containers/string.hpp: In function ???std::basic_istream<_CharT, _Traits>& boost::interprocess::getline(std::istream&, boost::interprocess::basic_string<CharT, Traits, A>&, CharT)???:
../boost/interprocess/containers/string.hpp:2398: error: invalid use of incomplete type ???struct std::basic_istream<char, std::char_traits<char> >???
/var/tmp/stdcxx/4.2.x/include/rw/_iosfwd.h:69: error: declaration of ???struct std::basic_istream<char, std::char_traits<char> >???
../boost/interprocess/containers/string.hpp:2405: error: invalid use of incomplete type ???struct std::basic_istream<char, std::char_traits<char> >???
/var/tmp/stdcxx/4.2.x/include/rw/_iosfwd.h:69: error: declaration of ???struct std::basic_istream<char, std::char_traits<char> >???
../boost/interprocess/containers/string.hpp:2419: error: invalid use of incomplete type ???struct std::basic_istream<char, std::char_traits<char> >???
/var/tmp/stdcxx/4.2.x/include/rw/_iosfwd.h:69: error: declaration of ???struct std::basic_istream<char, std::char_traits<char> >???

Using of the std::istream class methods requires #including <istream> header file. There also used std::ostream class methods.

The proposed patch:

Index: boost/interprocess/containers/string.hpp
===================================================================
--- boost/interprocess/containers/string.hpp	(revision 49128)
+++ boost/interprocess/containers/string.hpp	(working copy)
@@ -51,6 +51,8 @@
 #include <algorithm>
 #include <iosfwd>
 #include <ios>
+#include <istream>
+#include <ostream>
 #include <locale>
 #include <cstddef>
 #include <climits>

Change History (1)

comment:1 by Ion Gaztañaga, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in Boost 1.37. Thanks for the report.

Note: See TracTickets for help on using tickets.