www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++.beta - Ambiguous type conversion with __int64

Hi,

The short C++ excerpt provided below causes DMC to display:

     v3 = v1 + v2;
                 ^
int64.cpp(20) : Error: ambiguous type conversion
--- errorlevel 1

I compiled using the command line:

dmc -c -g -mn -WD -L/noi -L/nol int64.cpp

Any idea what might be causing this? The same code compiles fine using 
MSVC or GCC.

Best regards,
Gilles

class INT64 {
public:
     __int64         mValue;
public:
     INT64();
     INT64(const INT64 &);
     INT64(__int64);
     // operators
     INT64 &operator =(const INT64 &);
     INT64 &operator =(__int64);
     operator __int64() const { return mValue; }
};

void main()
{
     INT64 v1(2);
     INT64 v2(4);
     INT64 v3;

     v3 = v1 + v2;
}
May 09 2006