Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 455 by howard.h...@gmail.com: google/protobuf/message.cc is missing #include <istream>
http://code.google.com/p/protobuf/issues/detail?id=455

What steps will reproduce the problem?

Compile using clang and libc++:

clang++ -stdlib=libc++ -c -I../.. -I../../.. message.cc

What is the expected output?

A clean compile.

 What do you see instead?

message.cc:130:60: error: implicit instantiation of undefined template 'std::__1::basic_istream<char, std::__1::char_traits<char> >'
  return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();
                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:108:27: note: template is
      declared here
    class _LIBCPP_VISIBLE basic_istream;
                          ^
message.cc:135:67: error: implicit instantiation of undefined template 'std::__1::basic_istream<char, std::__1::char_traits<char> >'
  return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();
                                                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:108:27: note: template is
      declared here
    class _LIBCPP_VISIBLE basic_istream;
                          ^
message.cc:175:16: error: implicit instantiation of undefined template 'std::__1::basic_ostream<char, std::__1::char_traits<char> >'
  return output->good();
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:110:27: note: template is
      declared here
    class _LIBCPP_VISIBLE basic_ostream;
                          ^
3 errors generated.


What version of the product are you using? On what operating system?

2.4.1 on OX X 10.8.2

Please provide any additional information below.

Here is a patch to fix the bug:


--- message.cc  2013-01-21 13:35:40.000000000 -0500
+++ message copy.cc     2013-01-21 13:34:44.000000000 -0500
@@ -49,6 +49,8 @@
 #include <google/protobuf/stubs/map-util.h>
 #include <google/protobuf/stubs/stl_util-inl.h>

+#include <istream>
+
 namespace google {
 namespace protobuf {



--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to