From: Sean Hunt Date: Wed, 22 Jun 2011 02:25:26 +0000 (+0000) Subject: Avoid making assumption that this is either a CXXMethodDecl or a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4dba7b56d4551b7e03e20eeb7f45e5c962baa20c;p=clang Avoid making assumption that this is either a CXXMethodDecl or a FunctionTemplateDecl. I'm not quite sure what else it could be, though, and would appreciate some insight. This ought to fix the broken builds git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133600 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 46058b69d1..df4484e0b3 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -2273,8 +2273,7 @@ Sema::SpecialMemberOverloadResult *Sema::LookupSpecialMember(CXXRecordDecl *D, ArgType->getPointeeType().isConstQualified()) Result->setConstParamMatch(true); } - } else { - FunctionTemplateDecl *Tmpl = cast(*I); + } else if (FunctionTemplateDecl *Tmpl = cast(*I)) { AddTemplateOverloadCandidate(Tmpl, DeclAccessPair::make(Tmpl, AS_public), 0, &Arg, NumArgs, OCS, true); }