]> granicus.if.org Git - clang/commitdiff
When building candidate set for built-ins; when looking for
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Oct 2009 17:26:09 +0000 (17:26 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Oct 2009 17:26:09 +0000 (17:26 +0000)
convesion functions, look in base classes to.
(Removes a FIXME).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83472 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp
test/SemaCXX/builtin-ptrtomember-overload.cpp

index d637ed51b1b154ae9b7836a739c83c3eedba5ffa..e7cd4fb5757811483ec9679db9617ed574d11a7b 100644 (file)
@@ -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) {
index 8c6fb397356295a70c43944cf95d6f0401e6fed6..718e981805aa6cc1aaa0ce019b11fb026b2d7946 100644 (file)
@@ -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;
 }