[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 04:40:52 PDT 2019


kadircet added inline comments.


================
Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4135
+        !PotentialTemplateName.getAsIdentifierInfo()->getName().contains(
+            "function"))
+      return nullptr;
----------------
This looks cheesy, do we really want to perform this operation only for templates with `"function"` in their names?

As discussed offline maybe perform this for any template with a single(non-defaulted?) argument, or maybe even better perform a type-check as suggested by you. But I believe there would be too many false positives with the current state.


================
Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4154
+                                   Results.getCodeCompletionTUInfo());
+  // [](<parameters>) {}
+  Completion.AddChunk(CodeCompletionString::CK_LeftBracket);
----------------
maybe also add a placeholder for captures?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62238





More information about the cfe-commits mailing list