[PATCH] D124351: [Clang] Implement Change scope of lambda trailing-return-type

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 12 23:32:30 PDT 2023


ChuanqiXu added a comment.

It looks like that the `Create` template functions get merged expectedly. And the dummy variable shouldn't get merged since it is not in a mergeable primary context (function context is not a mergeable primary context) (see https://github.com/llvm/llvm-project/blob/23bd0e037b744d1f93bdfad59b7575017725a96c/clang/lib/Serialization/ASTReaderDecl.cpp#L3107-L3151).

When I remove the use of `dummy` in the captures list, https://github.com/llvm/llvm-project/blob/23bd0e037b744d1f93bdfad59b7575017725a96c/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp#L6079 is not executed. No matter if the `dummy` variable is captured or not, https://github.com/llvm/llvm-project/blob/23bd0e037b744d1f93bdfad59b7575017725a96c/clang/lib/Sema/SemaTemplateInstantiate.cpp#L4069-L4088 will execute twice for the `dummy` variable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124351



More information about the cfe-commits mailing list