Opened 12 years ago

Closed 12 years ago

#611 closed defect (fixed)

Error in template usage when compiling with Sun Studio 12 and stlport4

Reported by: Dagobert Michelsen Owned by: Olly Betts
Priority: normal Milestone: 1.2.14
Component: Other Version: 1.2.13
Severity: blocker Keywords:
Cc: Blocked By:
Blocking: Operating System: Solaris

Description

Hi,

when I try to compile xapian-core 1.2.13 on Solaris 10 Sparc with Sun Studio 12 I get the following template compilation error:

gmake[2]: Entering directory `/home/dam/mgar/pkg/xapian-core/trunk/work/solaris10-sparc/build-isa-sparcv8plus/xapian-core-1.2.13'
source='examples/quest.cc' object='examples/quest.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ./depcomp \
/opt/SUNWspro/bin/CC -DHAVE_CONFIG_H -I.  -I./common -I./include  -I/opt/csw/include -library=stlport4 -features=tmplife   -xO3 -m32 -xarch=sparc -c -o examples/quest.o examples/quest.cc
"/opt/SUNWspro/prod/include/CC/stlport4/stl/_algobase.c", line 375: Error: Formal argument __x of type const char*const& in call to std::less<const char*>::operator()(const char*const&, const char*const&) const is being passed qp_flag.
"/opt/SUNWspro/prod/include/CC/stlport4/stl/_algo.h", line 491:     Where: While instantiating "std::__lower_bound<qp_flag*, const char*, std::less<const char*>, int>(qp_flag*, qp_flag*, const char*const&, std::less<const char*>, int*)".
"/opt/SUNWspro/prod/include/CC/stlport4/stl/_algo.h", line 491:     Where: Instantiated from non-template code.
1 Error(s) detected.
gmake[2]: *** [examples/quest.o] Error 1

Attachments (1)

quest-fix.patch (842 bytes ) - added by Olly Betts 12 years ago.
Attempt to fix this

Download all attachments as: .zip

Change History (6)

comment:1 by Olly Betts, 12 years ago

Status: newassigned

I guess we'll have to construct a temporary qp_flag instead of just overloading operator< here.

by Olly Betts, 12 years ago

Attachment: quest-fix.patch added

Attempt to fix this

comment:2 by Olly Betts, 12 years ago

Milestone: 1.2.14

Can you try the attached patch, please?

comment:3 by Dagobert Michelsen, 12 years ago

I can confirm that the test works. Now I have several failing tests. I will open another ticket for that. Thanks again for the patch!

comment:4 by Dagobert Michelsen, 12 years ago

I meant "I can confirm that the patch works". The source now compiles cleanly on Sun Studio 12.

comment:5 by Olly Betts, 12 years ago

Resolution: fixed
Status: assignedclosed

Thanks for testing - committed to trunk (for 1.3.1) in r17048 and for 1.2.14 in r17050.

Note: See TracTickets for help on using tickets.