[cfe-dev] PATCH: Overloaded function declarations in C++

Doug Gregor doug.gregor at gmail.com
Mon Sep 8 18:10:04 PDT 2008


On Tue, Sep 9, 2008 at 4:36 AM, Argiris Kirtzidis <akyrtzi at gmail.com> wrote:
> Is OverloadedFunctionDecl ever going to be used as a ValueDecl ?
> If not, we can make it more compact as a NamedDecl, and use a specialized
> OverloadRefExpr(OverloadedFunctionDecl) for expressions. (or make
> DeclRefExpr accept a NamedDecl).

I can't think of anywhere that we would need an OverloadedFunctionDecl
to be a ValueDecl, except to satisfy DeclRefExpr.

I like the idea of making DeclRefExpr only require a NamedDecl. It
allows OverloadedFunctionDecl to shrink considerably, and shouldn't
affect DeclRefExpr at all. Sema::ActOnIdentifierExpr will need a
slight tweak to fill in the OverloadType for OverloadedFunctionDecls,
but that's trivial. Good idea!

  - Doug



More information about the cfe-dev mailing list