forked from OSchip/llvm-project
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:
parent
6bbefc2f67
commit
ae01f78a31
|
@ -3029,9 +3029,8 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty,
|
|||
}
|
||||
|
||||
CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(TyRec->getDecl());
|
||||
// FIXME: Visit conversion functions in the base classes, too.
|
||||
OverloadedFunctionDecl *Conversions
|
||||
= ClassDecl->getConversionFunctions();
|
||||
= ClassDecl->getVisibleConversionFunctions();
|
||||
for (OverloadedFunctionDecl::function_iterator Func
|
||||
= Conversions->function_begin();
|
||||
Func != Conversions->function_end(); ++Func) {
|
||||
|
|
|
@ -12,8 +12,7 @@ struct C : B {
|
|||
|
||||
|
||||
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; // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C'}}
|
||||
int j = c->*pmf;
|
||||
int i = b->*pmf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue