[cfe-commits] r83495 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/SemaCXX/addr-of-overloaded-function.cpp
Douglas Gregor
dgregor at apple.com
Fri Oct 9 15:51:34 PDT 2009
On Oct 7, 2009, at 3:26 PM, Anders Carlsson wrote:
> Author: andersca
> Date: Wed Oct 7 17:26:29 2009
> New Revision: 83495
>
> URL: http://llvm.org/viewvc/llvm-project?rev=83495&view=rev
> Log:
> Handle MemberExprs in ResolveAddressOfOverloadedFunction.
>
> Modified:
> cfe/trunk/lib/Sema/SemaOverload.cpp
> cfe/trunk/test/SemaCXX/addr-of-overloaded-function.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=83495&r1=83494&r2=83495&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed Oct 7 17:26:29 2009
> @@ -4117,6 +4117,9 @@
> if (DeclRefExpr *DR = dyn_cast<DeclRefExpr>(OvlExpr)) {
> Ovl = dyn_cast<OverloadedFunctionDecl>(DR->getDecl());
> FunctionTemplate = dyn_cast<FunctionTemplateDecl>(DR->getDecl());
> + } else if (MemberExpr *ME = dyn_cast<MemberExpr>(OvlExpr)) {
> + Ovl = dyn_cast<OverloadedFunctionDecl>(ME->getMemberDecl());
> + FunctionTemplate = dyn_cast<FunctionTemplateDecl>(ME-
> >getMemberDecl());
> }
Okay, looks good.
We probably have to cope with explicitly-specified template arguments
in a MemberExpr for when
f<int>
is a member function. Of course, we also may have to handle
TemplateIdRefExprs... I've added FIXMEs.
- Doug
More information about the cfe-commits
mailing list