Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/C++/Front End/Overloading    [ Add a report in this area ]  
Report #:  18980   Status: Closed
(Pulled) [C++ Error] Project2.cpp(27): E2015 Ambiguity between 'Bar::bar(void (Derived::*)())' and 'Bar::bar(int Derived::*)'.The followi
Project:  C++Builder Build #:  4.0.14.10
Version:    4.0 Submitted By:   John Kaster
Report Type:  Basic functionality failure Date Reported:  6/7/1999 12:00:00 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   61785
Resolution: Fixed (Resolution Comments) Resolved in Build: : 12.0.3040.12863
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
[C++ Error] Project2.cpp(27): E2015 Ambiguity between 'Bar::bar(void (Derived::*)())' and 'Bar::bar(int Derived::*)'.The following code reports an ambiguity.
[C++ Error] Project2.cpp(28): E2015 Ambiguity between 'Bar::bar(void (Derived::*)())' and 'Bar::bar(int Derived::*)'.

class Base {
public:
  void foo();
  int i;
};

class Derived : public Base {};

class Bar {
public:
  void bar(void (Derived::*)(void));
  void bar(int Derived::*);
};


int main()
{
  Bar a;

  a.bar(&Derived::foo); //line 27
  a.bar(&Derived::i);     //line 28
}
Steps to Reproduce:
bcc32 61785.cpp
//res:
Error E2015 61785.cpp 27: Ambiguity between 'Bar::bar(void (Derived::*)())' and 'Bar::bar(int Derived::*)' in function main()
Error E2015 61785.cpp 28: Ambiguity between 'Bar::bar(void (Derived::*)())' and 'Bar::bar(int Derived::*)' in function main()
//exp: builds, when run prints passed

--- original text ---
compile sample code in Description pane
Workarounds
None
Attachment
N
Comments

None

Server Response from: ETNACODE01