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

New issue 166 by maciej.blizinski: by_symbol_.insert(iter, make_pair(name, value)); fails with Sun Studio 12
http://code.google.com/p/protobuf/issues/detail?id=166

What steps will reproduce the problem?
1. Try to build with Sun Studio 12
2.
3.

What is the expected output? What do you see instead?
Line 131 of google/protobuf/descriptor_database.cc should successfully
expand.

What version of the product are you using? On what operating system?
2.3.0, Sun Studio 12, Solaris 9 and 10.

Please provide any additional information below.

The error is:

by_symbol_.insert(iter, make_pair(name, value)); fails with:

gmake[4]: Entering directory
`/home/maciej/src/opencsw/pkg/protobuf/trunk/work/solaris9-sparc/build-isa-
sparcv8/protobuf-2.3.0/src'
source='google/protobuf/descriptor_database.cc'
object='descriptor_database.lo' libtool=yes \
        DEPDIR=.deps depmode=none /bin/bash ../depcomp \
        /bin/bash ../libtool --tag=CXX   --mode=compile
/opt/studio/SOS12/SUNWspro/bin/CC -DHAVE_CONFIG_H -I. -I..   -
I/opt/csw/include -D_REENTRANT   -xmemalign=8s -xO3 -m32 -xarch=v8 -c -o
descriptor_database.lo `test -f 'google/protobuf/descriptor_database.cc' ||
echo './'`google/protobuf/descriptor_database.cc
libtool: compile:  /opt/studio/SOS12/SUNWspro/bin/CC -DHAVE_CONFIG_H -I. -
I.. -I/opt/csw/include -D_REENTRANT -xmemalign=8s -xO3 -m32 -xarch=v8 -c
google/protobuf/descriptor_database.cc  -KPIC -DPIC -o
.libs/descriptor_database.o
"./google/protobuf/descriptor.h", line 324: Warning: Identifier expected
instead of "}".
"./google/protobuf/descriptor.h", line 343: Warning: Identifier expected
instead of "}".
"./google/protobuf/descriptor.h", line 354: Warning: Identifier expected
instead of "}".
"./google/protobuf/wire_format_lite.h", line 95: Warning: Identifier
expected instead of "}".
"./google/protobuf/wire_format_lite.h", line 118: Warning: Identifier
expected instead of "}".
"./google/protobuf/wire_format_lite.h", line 133: Warning: Identifier
expected instead of "}".
"google/protobuf/descriptor_database.cc", line 131: Error: Could not find a
match for std::map<std::string,const
google::protobuf::FileDescriptorProto*>::insert(__rwstd::__rb_tree<std::str
ing, std::pair<const std::string, const
google::protobuf::FileDescriptorProto*>,
__rwstd::__select1st<std::pair<const std::string, const
google::protobuf::FileDescriptorProto*>, std::string>,
std::less<std::string>, std::allocator<std::pair<const std::string, const
google::protobuf::FileDescriptorProto*>>>::iterator, std::pair<std::string,
const google::protobuf::FileDescriptorProto*>) needed in
google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<const
google::protobuf::FileDescriptorProto*>::AddSymbol(const std::string &,
const google::protobuf::FileDescriptorProto*).
"google/protobuf/descriptor_database.cc", line 69:     Where: While
instantiating
"google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<const
google::protobuf::FileDescriptorProto*>::AddSymbol(const std::string &,
const google::protobuf::FileDescriptorProto*)".
"google/protobuf/descriptor_database.cc", line 69:     Where: Instantiated
from google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<const
google::protobuf::FileDescriptorProto*>::AddFile(const
google::protobuf::FileDescriptorProto&, const
google::protobuf::FileDescriptorProto*).
"google/protobuf/descriptor_database.cc", line 265:     Where: Instantiated
from non-template code.
1 Error(s) and 6 Warning(s) detected.
gmake[4]: *** [descriptor_database.lo] Error 1
gmake[4]: Leaving directory
`/home/maciej/src/opencsw/pkg/protobuf/trunk/work/solaris9-sparc/build-isa-
sparcv8/protobuf-2.3.0/src'



I looked up the prototype of the insert() method for Sun Studio:

/opt/studio/SOS12/SUNWspro/prod/include/CC/stlport4/stl/_map.h

line 171:

  iterator insert(iterator position, const value_type& __x)
    { return _M_t.insert_unique(position, __x); }

Looks right to me, since by_symbol_ is of type:
map<string, Value> by_symbol_;

I'm not sure what is the problem there.  The iterator (here "iter") has the
right type:

typename std :: map < string , Value > :: iterator iter =
FindLastLessOrEqual ( name ) ;

I'm suspecting something about the 'name' variable.  The error message says
that it can't find a match for:
AddSymbol(const std::string &, const
google::protobuf::FileDescriptorProto*)

But higher up, the map definition is <string, Value>, so I suspect that
there might be something about "string" vs "const string&".

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@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