diff options
| author | John McCall <rjmccall@apple.com> | 2010-03-31 01:36:47 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-03-31 01:36:47 +0000 |
| commit | da4458e98f54c009116cf4073e065d69fc99e186 (patch) | |
| tree | 15754852a882f962f75f8508de5d857d85c5aeb6 /clang/lib/Sema/SemaOverload.cpp | |
| parent | 034299ef25d3468319fa8d447b784501d7f7e25d (diff) | |
| download | bcm5719-llvm-da4458e98f54c009116cf4073e065d69fc99e186.tar.gz bcm5719-llvm-da4458e98f54c009116cf4073e065d69fc99e186.zip | |
Regularize support for naming conversion functions in using decls.
llvm-svn: 99979
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 8d3313982c8..be367c3660e 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -1582,10 +1582,10 @@ OverloadingResult Sema::IsUserDefinedConversion(Expr *From, QualType ToType, CXXConversionDecl *Conv; FunctionTemplateDecl *ConvTemplate; - if ((ConvTemplate = dyn_cast<FunctionTemplateDecl>(*I))) - Conv = dyn_cast<CXXConversionDecl>(ConvTemplate->getTemplatedDecl()); + if ((ConvTemplate = dyn_cast<FunctionTemplateDecl>(D))) + Conv = cast<CXXConversionDecl>(ConvTemplate->getTemplatedDecl()); else - Conv = dyn_cast<CXXConversionDecl>(*I); + Conv = cast<CXXConversionDecl>(D); if (AllowExplicit || !Conv->isExplicit()) { if (ConvTemplate) @@ -3310,13 +3310,16 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty, = ClassDecl->getVisibleConversionFunctions(); for (UnresolvedSetImpl::iterator I = Conversions->begin(), E = Conversions->end(); I != E; ++I) { + NamedDecl *D = I.getDecl(); + if (isa<UsingShadowDecl>(D)) + D = cast<UsingShadowDecl>(D)->getTargetDecl(); // Skip conversion function templates; they don't tell us anything // about which builtin types we can convert to. - if (isa<FunctionTemplateDecl>(*I)) + if (isa<FunctionTemplateDecl>(D)) continue; - CXXConversionDecl *Conv = cast<CXXConversionDecl>(*I); + CXXConversionDecl *Conv = cast<CXXConversionDecl>(D); if (AllowExplicitConversions || !Conv->isExplicit()) { AddTypesConvertedFrom(Conv->getConversionType(), Loc, false, false, VisibleQuals); @@ -3378,7 +3381,10 @@ static Qualifiers CollectVRQualifiers(ASTContext &Context, Expr* ArgExpr) { for (UnresolvedSetImpl::iterator I = Conversions->begin(), E = Conversions->end(); I != E; ++I) { - if (CXXConversionDecl *Conv = dyn_cast<CXXConversionDecl>(*I)) { + NamedDecl *D = I.getDecl(); + if (isa<UsingShadowDecl>(D)) + D = cast<UsingShadowDecl>(D)->getTargetDecl(); + if (CXXConversionDecl *Conv = dyn_cast<CXXConversionDecl>(D)) { QualType CanTy = Context.getCanonicalType(Conv->getConversionType()); if (const ReferenceType *ResTypeRef = CanTy->getAs<ReferenceType>()) CanTy = ResTypeRef->getPointeeType(); |

