When building candidate set for built-ins; when looking for

convesion functions, look in base classes to.
(Removes a FIXME).

llvm-svn: 83472
This commit is contained in:
Fariborz Jahanian 2009-10-07 17:26:09 +00:00
parent 6bbefc2f67
commit ae01f78a31
2 changed files with 2 additions and 4 deletions

View File

@ -3029,9 +3029,8 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty,
} }
CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(TyRec->getDecl()); CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(TyRec->getDecl());
// FIXME: Visit conversion functions in the base classes, too.
OverloadedFunctionDecl *Conversions OverloadedFunctionDecl *Conversions
= ClassDecl->getConversionFunctions(); = ClassDecl->getVisibleConversionFunctions();
for (OverloadedFunctionDecl::function_iterator Func for (OverloadedFunctionDecl::function_iterator Func
= Conversions->function_begin(); = Conversions->function_begin();
Func != Conversions->function_end(); ++Func) { Func != Conversions->function_end(); ++Func) {

View File

@ -12,8 +12,7 @@ struct C : B {
void foo(C c, B b, int A::* pmf) { void foo(C c, B b, int A::* pmf) {
// FIXME. Bug or correct? gcc accepts it. It requires derived-to-base followed by user defined conversion to work. int j = c->*pmf;
int j = c->*pmf; // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C'}}
int i = b->*pmf; int i = b->*pmf;
} }