Archived

This forum has been archived. Please start a new discussion on GitHub.

problems with VC8.0

Hi!

I don't know exactly if this case matches to the bug that was fixed with one of the patches, thus I'd like to post the trouble code here. If I try to compile the slice2cpp-ed code of this module:
module TestModule
{
	dictionary<string, Ice::ByteSeq> FileMap;
	
	interface TestInterface
	{
		FileMap returnMyMap();
	};
};

I receive error messages on this result code:
void
TestModule::__read(::IceInternal::BasicStream* __is, ::TestModule::FileMap& v, ::TestModule::__U__FileMap)
{
    ::Ice::Int sz;
    __is->readSize(sz);
    while(sz--)
    {
	::std::pair<const  ::std::string, ::Ice::ByteSeq> pair;
	__is->read(const_cast< ::std::string&>(pair.first));
	::TestModule::FileMap::iterator __i = v.insert(v.end(), pair);
	::std::pair<const ::Ice::Byte*, const ::Ice::Byte*> _____i->second;
	__is->read(_____i->second);
	::std::vector< ::Ice::Byte>(_____i->second.first, _____i->second.second).swap(__i->second);
    }
}

.\test.cpp(112) : error C2143: syntax error : missing ';' before '->'
.\test.cpp(113) : error C2819: type 'std::pair<_Ty1,_Ty2>' does not have an overloaded member 'operator ->'
        with
        [
            _Ty1=const Ice::Byte *,
            _Ty2=const Ice::Byte *
        ]
        did you intend to use '.' instead?
.\test.cpp(113) : error C2232: '->std::pair<_Ty1,_Ty2>::second' : left operand has 'struct' type, use '.'
        with
        [
            _Ty1=const Ice::Byte *,
            _Ty2=const Ice::Byte *
        ]
.\test.cpp(114) : error C2819: type 'std::pair<_Ty1,_Ty2>' does not have an overloaded member 'operator ->'
        with
        [
            _Ty1=const Ice::Byte *,
            _Ty2=const Ice::Byte *
        ]
        did you intend to use '.' instead?
.\test.cpp(114) : error C2232: '->std::pair<_Ty1,_Ty2>::second' : left operand has 'struct' type, use '.'
        with
        [
            _Ty1=const Ice::Byte *,
            _Ty2=const Ice::Byte *
        ]
.\test.cpp(114) : error C2228: left of '.first' must have class/struct/union
.\test.cpp(114) : error C2819: type 'std::pair<_Ty1,_Ty2>' does not have an overloaded member 'operator ->'
        with
        [
            _Ty1=const Ice::Byte *,
            _Ty2=const Ice::Byte *
        ]
        did you intend to use '.' instead?
.\test.cpp(114) : error C2232: '->std::pair<_Ty1,_Ty2>::second' : left operand has 'struct' type, use '.'
        with
        [
            _Ty1=const Ice::Byte *,
            _Ty2=const Ice::Byte *
        ]
.\test.cpp(114) : error C2228: left of '.second' must have class/struct/union
.\test.cpp(114) : error C2228: left of '.swap' must have class/struct/union

Did I do something wrong or has the slice compiler cause this problem?

regs,

Stephan

Comments

  • bernard
    bernard Jupiter, FL
    Hi Stephan,

    Thanks for the bug report; it is not fixed by one of the existing 3.1.0 patches.

    It's a bug in the code generated for dictionaries where the value is a byte sequence (the interface has nothing to do with it).

    Best regards,
    Bernard
  • dwayne
    dwayne St. John's, Newfoundland
    Hi,

    I have posted a patch for this problem [thread=2512]here[/thread].

    Thanks again for the bug report.

    Regards,
    Dwayne