INF: C2385 and C2386 Documented Only in Online Help
PSS ID Number: Q104673
Article last modified on 12-21-1993

7.00

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft C/C++ compiler for MS-DOS, version 7.0
----------------------------------------------------------------------

SUMMARY
=======

Two error messages are not documented in the "Comprehensive Index and
Errors Reference" or in the ERRATA.TXT file. They are included in the
online help files. The errors are:

   C2385  'class::member' is ambiguous
   C2386  ambiguous conversion from 'type1*' to 'type2*'

MORE INFORMATION
================

The Quick Help file, available through either the Programmer's
WorkBench (PWB) or QH.EXE MS-DOS command, gives the following
information:

Compiler Error C2385
--------------------

'class::member' is ambiguous

The specified member was derived from more than one object.

This error is caused by referencing a member of an object that was
inherited from more than one object. Make the member unambiguous by
providing a cast or by changing the name of the offending members of
the base classes.

Warning C4385 is generated in conjunction with this error, and
provides additional information about the ambiguity.

The following is an example of this error:

   struct A { int x; };
   struct B { int x; };
   struct C : A, B {};
   void func ()
   {
      C aC;
      aC.x = 9;        // error
   }

Compiler Error C2386
--------------------

Ambiguous conversion from 'type1*' to 'type2*'

There was more than one way to make the specified conversion.

Provide an explicit type conversion or change the organization of
classes so that the conversion is no longer ambiguous.

Warning C4386 is generated in conjunction with this error, and
provides additional information about the ambiguity.

The following is an example of this error:

   struct A {};
   struct B : A {};
   struct C : A {};
   struct D : B, C {};
   void bar ()
   {
      D *pD;
      A *pA;
      pA = pD;            // error
   }

Additional reference words: 7.00
KBCategory: Refs
KBSubcategory:

=============================================================================

Copyright Microsoft Corporation 1993.
