[cfe-commits] r83472 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/SemaCXX/builtin-ptrtomember-overload.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Oct 7 10:26:10 PDT 2009
Author: fjahanian
Date: Wed Oct 7 12:26:09 2009
New Revision: 83472
URL: http://llvm.org/viewvc/llvm-project?rev=83472&view=rev
Log:
When building candidate set for built-ins; when looking for
convesion functions, look in base classes to.
(Removes a FIXME).
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/test/SemaCXX/builtin-ptrtomember-overload.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=83472&r1=83471&r2=83472&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed Oct 7 12:26:09 2009
@@ -3029,9 +3029,8 @@
}
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) {
Modified: cfe/trunk/test/SemaCXX/builtin-ptrtomember-overload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/builtin-ptrtomember-overload.cpp?rev=83472&r1=83471&r2=83472&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/builtin-ptrtomember-overload.cpp (original)
+++ cfe/trunk/test/SemaCXX/builtin-ptrtomember-overload.cpp Wed Oct 7 12:26:09 2009
@@ -12,8 +12,7 @@
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;
}
More information about the cfe-commits
mailing list