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

2020-03-31 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa76e68c9704f: [CodeComplete] Member completion for concept-constrained types. (authored by sammccall). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-03-26 Thread Sam McCall via Phabricator via cfe-commits
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

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

2020-03-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM. thanks! Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4984 +if (Q && isApprox(Q->getAsType(), T)) + addType(NNS->getAsIdentifier()); + }

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

2020-03-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Thanks! Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4905 + // A requires(){...} lets us infer members from each requirement. + for (const concepts::Requirement *Req : RE->getRequirements()) { +if (!Req->isDependent())

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

2020-03-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 252917. sammccall marked 13 inline comments as done. sammccall added a comment. address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73649/new/ https://reviews.llvm.org/D73649 Files:

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

2020-03-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang/include/clang/Sema/Scope.h:323 /// declared in. - bool isDeclScope(Decl *D) { -return DeclsInScope.count(D) != 0; - } + bool isDeclScope(const Decl *D) { return DeclsInScope.count(D) != 0; } also mark

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

2020-03-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. @kadircet I realized this change was gathering dust, and you've touched SemaCodeComplete in recent memory... any interest? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73649/new/ https://reviews.llvm.org/D73649

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

2020-03-03 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. Thanks! Consider the patch "accepted" from my POV. One last nit: please link to https://github.com/clangd/clangd/issues/261 in the commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73649/new/

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

2020-03-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 247993. sammccall added a comment. comment and tweak order of AccessOperator Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73649/new/ https://reviews.llvm.org/D73649 Files:

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

2020-03-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked an inline comment as done. sammccall added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:5006 + if (/*Inserted*/ R.second || + std::make_tuple(M.Operator, M.ArgTypes.hasValue(), + M.ResultType != nullptr)

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

2020-03-03 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4972 + +// In T::foo::bar, `foo` must be a type. +bool VisitNestedNameSpecifier(NestedNameSpecifier *NNS) { nridge wrote: > sammccall wrote: > > nridge wrote: > > > It would be

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

2020-03-03 Thread Nathan Ridge via Phabricator via cfe-commits
nridge marked 3 inline comments as done. nridge added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4856 +private: + // Infer members of T, given that the expression E (dependent on T) is true. + void believe(const Expr *E, const TemplateTypeParmType *T) {

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

2020-03-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. > I'm not sure that I'm qualified to approve this patch (this is my first time > looking at clang's completion code) I feel the same way about writing the code :-) Thanks for the comments! I'll get another review from someone who's stared into this abyss before, too.

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

2020-03-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 247751. sammccall marked 27 inline comments as done. sammccall added a comment. Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73649/new/ https://reviews.llvm.org/D73649 Files:

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

2020-03-02 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4860 + return; +if (auto *CSE = llvm::dyn_cast(E)) { + // If the concept is nridge wrote: > clang-tidy gives me an `'auto *CSE' can be declared as 'const auto *CSE'` >

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

2020-02-23 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. I'm not sure that I'm qualified to approve this patch (this is my first time looking at clang's completion code), but I did look through the entire patch now, and it looks good to me modulo the mentioned, mostly minor, comments. Comment at:

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

2020-02-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 3 inline comments as done. sammccall added inline comments. Comment at: clang/lib/Sema/CodeCompleteConsumer.cpp:592 } +for (const FixItHint : Results[I].FixIts) { + const SourceLocation BLoc = FixIt.RemoveRange.getBegin(); (This

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

2020-02-18 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. Thanks for looking at this! Sorry for the late response, I was travelling for a few weeks. So far I've only had a chance to look at the tests. Comment at: clang/test/CodeCompletion/concepts.cpp:34 + // RUN: | FileCheck %s -check-prefix=DOT

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

2020-01-29 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. {icon check-circle color=green} Unit tests: pass. 62282 tests passed, 0 failed and 827 were skipped. {icon times-circle color=red} clang-tidy: fail. clang-tidy found 0 errors and 7 warnings

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

2020-01-29 Thread Sam McCall via Phabricator via cfe-commits
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