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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 10:44:36 PST 2020


sammccall created this revision.
sammccall added reviewers: nridge, saar.raz.
Herald added subscribers: cfe-commits, mgrang.
Herald added a project: clang.

The basic idea is to walk through the concept definition, looking for
t.foo() where t has the constrained type.

In this patch:

- nested types are recognized and offered after ::
- variable/function members are recognized and offered after the correct dot/arrow/colon trigger
- member functions are recognized (anything directly called). parameter types are presumed to be the argument types. parameters are unnamed.
- result types are available when a requirement has a type constraint. These are printed as constraints, except same_as<T> which prints as T.

Not in this patch:

- support for merging/overloading when two locations describe the same member. The last one wins, for any given name. This is probably important...
- support for nested template members (T::x<int>)
- support for completing members of (instantiations of) template template parameters


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73649

Files:
  clang/include/clang/Sema/Scope.h
  clang/lib/Sema/CodeCompleteConsumer.cpp
  clang/lib/Sema/SemaCodeComplete.cpp
  clang/test/CodeCompletion/concepts.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73649.241218.patch
Type: text/x-patch
Size: 24197 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200129/1f9888fe/attachment-0001.bin>


More information about the cfe-commits mailing list