Status: New
Labels: Type-Defect Priority-Medium

New issue 166 by maciej.blizinski: by_symbol_.insert(iter, make_pair(name, value)); fails with Sun Studio 12

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

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

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
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/' ||
echo './'`google/protobuf/
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/  -KPIC -DPIC -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/", line 131: Error: Could not find a
match for std::map<std::string,const
ing, std::pair<const std::string, const
__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::FileDescriptorProto*>::AddSymbol(const std::string &,
const google::protobuf::FileDescriptorProto*).
"google/protobuf/", line 69:     Where: While
google::protobuf::FileDescriptorProto*>::AddSymbol(const std::string &,
const google::protobuf::FileDescriptorProto*)".
"google/protobuf/", line 69:     Where: Instantiated
from google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<const
google::protobuf::FileDescriptorProto&, const
"google/protobuf/", 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

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


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

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:

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to