[PATCH] D148802: [Sema] Lambdas are not part of immediate context for deduction

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 06:52:48 PDT 2023


erichkeane accepted this revision.
erichkeane added a comment.
This revision is now accepted and ready to land.

In D148802#4326268 <https://reviews.llvm.org/D148802#4326268>, @ilya-biryukov wrote:

> Another friendly ping for review.
> @erichkeane let me know if you feel that exposing the incorrect lambda instantiation behavior is a blocker here.

I don't... we're up to ~4 active bugs on that, so its not like it is 'unexposed' now.  I think this looks good enough to accept;



================
Comment at: clang/test/SemaCXX/warn-unused-lambda-capture.cpp:192
 void test_use_template() {
-  test_templated<int>(); // expected-note{{in instantiation of function template specialization 'test_templated<int>' requested here}}
+  test_templated<int>(); // expected-note 13{{in instantiation of function template specialization 'test_templated<int>' requested here}}
 }
----------------
ilya-biryukov wrote:
> shafik wrote:
> > Why the 12 extra notes here, I feel I am missing something but not sure what. I see the increase in notes in other cases as well.
> I'm not entirely sure, but it seems there is some deduplication of notes that's happening when the stacks of code-synthesis-contexts for subsequent errors are the same.
> However, this patch introduces a different code synthesis context for lambda substitutions, forcing the notes to be added.
> In the new version of the patch, the added context actually shows up in the notes as well.
Note that this test is organized poorly, and the 12 additions are likely the levels added above, and it is 1 per error, so its just 1 more level of 'in instantiation...' in each of those cases above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148802



More information about the cfe-commits mailing list