[PATCH] D53847: [C++2a] P0634r3: Down with typename!

Nicolas Lesser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 10 10:38:06 PDT 2019


Rakete1111 added a comment.

rsmith:

> Some thoughts on this:
> 
> - Can this be unified with the lookup code in HandleDeclarator? This is really the same lookup, repeated in two places.

What I wrote:

> I don't think so, because HandleDeclarator is called after having already parsed the function declaration. I cached it now, but the cleanest solution that I could think of is to use new. Is this appropriate? Or do you have an alternative suggestion?

Maybe a `llvm::Optional` is more appropriate?

> - It'd be nice to cache this lookup, rather than performing it three times (once when disambiguating a parenthesized initializer from a function declaration, once when we're about to parse a parameter-declaration-clause, and once in HandleDeclarator after parsing completes -- though at least that's reduced to two lookups if you make the change I suggested in ParseParameterDeclarationClause)

Hmm let me see what I can do about that.

> - If we don't do the caching, what happens if lookup fails due to ambiguity? Do we get the same error multiple times (once for each time we perform the lookup)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53847/new/

https://reviews.llvm.org/D53847





More information about the cfe-commits mailing list