Mega Search
23.2 Million


Sign Up

Make a donation  
Overload resolution compiler bug  
News Group: borland.public.cppbuilder.language.cpp

struct B {
 void c() {};
};

struct E {
 bool c() {};
};

struct M : B, E {
 using E::c;
 using B::c;
};


#pragma argsused
int main(int argc, char* argv[])
{
 M m;
 m.c();
 return 0;
}


Overload resolution incorrectly selects B::c() with BCB2006.  Comeau
reports ambiguity with overload resolution as it should.

If the two using declarations are swapped around E::c() is selected.  It
appears that the last using declaration plays an incorrect part in
overload resolution.

Fraser.







Vote for best question.
Score: 0  # Vote:  0
Date Posted: 24-Dec-2007, at 6:51 AM EST
From: Fraser Ross