[PATCH] D73649: [CodeComplete] Member completion for concept-constrained types.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 15:14:52 PDT 2020


sammccall marked an inline comment as done.
sammccall added inline comments.


================
Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4984
+        if (Q && isApprox(Q->getAsType(), T))
+          addType(NNS->getAsIdentifier());
+      }
----------------
kadircet wrote:
> sammccall wrote:
> > kadircet wrote:
> > > as T is dependent i suppose NNS should always be an identifier, but would be nice to spell it out explicitly with a comment.
> > It doesn't need to be an identifier - it returns null and addType handles null.
> i thought NNS->getAsIdentifier had an assertion instead of returning null.
> 
> out of curiosity, when can this be non identifier though ?
In general (non-dependent code) NNS is normally a decl rather than an identifier.

But here in particular it can certainly be a typespec: that's the T::foo<X>::bar case mentioned in the comment, I think the NNS stores a TemplateSpecializationType for foo<X>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73649





More information about the cfe-commits mailing list