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++ - Is this an other compiler (8.33) bug? calling a member functies with the default parameter.

 #include <stdio.h>
 
 
 
 class  Test2
 {
    public :
       typedef unsigned short Test2_t;
 
       enum  Type
       {
          ONE,
          TWO,
          THREE,
       };
 
       static const char *TypeStr [ 4 ];
 
    public :
       Test2 () {}
 
       void         Set ( Test2_t  _one,  Test2_t  _two = 0 )
       {
          printf ( "Set ( Test2_t  _one = %d,  Test2_t  _two = %d )\n", _one,
_two );
       }
 
       void         Set ( Test2_t  _zero, Type  _type, int  _i = 9999, Test2_t 
_one = 0, Test2_t  _two = 0 )
       {
          printf ( "Set ( Test2_t  _zero = %d, Type  _type = %s, int  _i = %d,
Test2_t  _one = %d, Test2_t  _two = %d )", _zero,  TypeStr [ _type ], _i, _one,
_two );
       }
 };
 
 
 
 const char  *Test2 :: TypeStr [ 4 ] =
 {
    "ONE",
    "TWO",
    "THREE",
    0,
 };
 
 
 
 int  main ( int argc, char  *argv [] )
 {
    Test2 :: Test2_t  var      = 0;
    Test2             test;
 
    test.Set ( var, 0 );                      // this doen't work
    test.Set ( var, 1 );                      // this does
    test.Set ( var, Test2 :: ONE, 0, 0 );
 
    return ( 0 );
 }

P:\APK\DMC>s:\bin\dmc bug2.cpp test.Set ( var, 0 ); // this doen't work ^ bug2.cpp(50) : Error: ambiguous reference to symbol Had: Test2::Set(unsigned short ,unsigned short ) and: Test2::Set(unsigned short ,enum Test2::Type,int ,unsigned short ,unsigned short ) --- errorlevel 1
Apr 01 2003