[clang] [Serialization] Load Specializations Lazily (PR #76774)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 08:37:46 PST 2024


ilya-biryukov wrote:

We saw some failures internally with this patch:
- ` "'absl::AnyInvocable<void () &&>' has different definitions in different modules;". `
   Probably related to the template arguments stability you mention.
- `"No type named 'MemberType' in 'some_object::Traits<MyImportantClass>'"`.
  I suspect that's exposing some bug in modules that we were lucky to avoid before.
- `'std::pointer_traits<const proto2::FieldDescriptor **>::pointer_to' from module '<stl>/optional' is not present in definition of 'std::pointer_traits<const proto2::FieldDescriptor **>' provided earlier`
  Probably the same root cause as the previous item, but shows up as a different error message (although it does point out that we might have some diamond-dependency-style problem here).
- Code of the form
 ```cpp
auto* stream = new (arena_alloc(param.call->call())) Callback();
param.context->Begin([stream](bool) { stream->Done(); });
  ```
produces really weird error (as if lambda captured something from the line **prior to lambda**):
```shell
error: variable 'param' cannot be implicitly captured in a lambda with no capture-default specified
  679 |         auto* stream = new (arena_alloc(param.call->call())) Callback();
      |                                         ^
note: while substituting into a lambda expression here
  680 |   param.context->Begin([stream](bool) { stream->Done(); });
```
Looks unexpected. I suspect that it's a different issue (because of the way we test these things, we also include some extra commits from head that could have additional problems). However, I still wanted to mention it in case people here think it might be related.
- Crashes. They need more investigation.


We will to provide reproducers as soon as possible, but please bear with us for some time as module-related issues are very hard to minimize and share as a small code example due to lack of infrastructure. They normally happen on complicated build graphs with too many dependencies to easily reduce. However, I am optimistic at least about the template arguments issue because it seems to happen at `absl` layer, which has relatively few dependencies.

https://github.com/llvm/llvm-project/pull/76774


More information about the cfe-commits mailing list