[cfe-dev] PATCH: Overloaded function declarations in C++
akyrtzi at gmail.com
Tue Sep 9 01:36:18 PDT 2008
Doug Gregor wrote:
> On Mon, Sep 8, 2008 at 1:38 PM, Daniel Dunbar <daniel at zuster.org> wrote:
>> I agree with Argiris that having an OverloadType and Decl is counterintuitive,
>> although I think I understand the reason.
> Does Argiris still agree with this? I think I may have converted him :)
Yes, praise the lord, I am a "believer" now :)
> On Mon, Sep 8, 2008 at 3:36 PM, Daniel Dunbar <daniel at zuster.org> wrote:
>> The other part that seemed fake was that they are not a "decl" in the sense of
>> actually defining anything or existing per se in the source. Are they
>> a "Decl" for
>> any reason other than shoehorning into the types the Parser expects? And if so,
>> do they need to be a ValueDecl?
> I think they are declarations in the same sense that using
> declarations are declarations: while they don't necessarily introduce
> a new entity with a name, they do declare a binding for a particular
> name to one or more entities.
> OverloadedFunctionDecls are ValueDecls because DeclRefExpr needs to be
> able to refer to them. Plus, OverloadedFunctionDecls are "values" just
> like other functions... the only difference being that we don't know
> which value we're referring to just yet.
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).
More information about the cfe-dev