[PATCH] D140002: [C++20] [Modules] Merging of lambda types in deserialization

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 02:18:28 PST 2022


ChuanqiXu created this revision.
ChuanqiXu added reviewers: ilya-biryukov, rsmith, dblaikie, iains, erichkeane, tahonermann.
ChuanqiXu added a project: clang-modules.
Herald added a project: All.
ChuanqiXu requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Close https://github.com/llvm/llvm-project/issues/57222

The previous deserialization code wouldn't try to merge lambdas since every lambda has a unique type before C++20. In C++20 and later, lambdas can have the same type under certain condition. See the issue link or the comment for example.

Due to we don't care about merging unnamed entities before, now it is pretty problematic to fix it in a well formed.

This is a workaround for the problem but the cost is the inefficiency.  And if we want to fix the problem properly, it looks like we need to touch something very fundamentally and it may affect a lot of things beyond the C++20 modules or even modules.

See my inline comments for details.

The bug/defect has a strong impact. I feel like fixing bug is more important so I prefer to land this one first and file an issue for this to record it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140002

Files:
  clang/lib/Serialization/ASTReaderDecl.cpp
  clang/test/Modules/MergeLambdas.cppm
  clang/test/Modules/MergeLambdas2.cppm
  clang/test/Modules/MergeLambdas3.cppm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140002.482767.patch
Type: text/x-patch
Size: 11591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221214/9ae260cc/attachment-0001.bin>


More information about the cfe-commits mailing list