[cfe-dev] Using declarations for static member functions
John McCall
rjmccall at apple.com
Fri Jan 4 11:28:59 PST 2013
On Jan 4, 2013, at 1:28 AM, Daniel Jasper <djasper at google.com> wrote:
> In:
>
> class A {
> protected:
> static void f() {}
> };
>
> class B : public A {
> public:
> using A::f;
> };
>
> void f() {
> B::f();
> }
>
> The B::f() call creates a DeclRefExpr where the FoundDecl is the CXXMethodDecl A::f(). This is contrary to cases of non-static member functions (where the MemberExpr has a FoundDecl that is a UsingShadowDecl) and non-member functions in general (where the FoundDecl of the DeclRefExpr is a UsingShadowDecl).
>
> Is this a bug?
It does look like a bug. The way to fix it is to trace through Sema and figure out where the found decl is being changed.
John.
More information about the cfe-dev
mailing list