[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 08:10:26 PDT 2019


kadircet accepted this revision.
kadircet marked an inline comment as done.
kadircet added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4142
+  // Handle other cases.
+  if (T->isPointerType())
+    T = T->getPointeeType();
----------------
ilya-biryukov wrote:
> kadircet wrote:
> > what about referencetype?
> > 
> > ```
> > void test();
> > void (&y)() = test;
> > ```
> Lambdas are r-values, so suggesting them for l-value references would lead to an error.
> R-value references to functions are so rare that I feel handling those is not worth it.
ah right


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