Re: [PATCH 1/2] c++: modules and non-dependent auto deduction

2022-09-20 Thread Nathan Sidwell via Gcc-patches
On 9/20/22 15:54, Patrick Palka wrote: The modules streaming code seems to rely on the invariant that a TEMPLATE_DECL and its DECL_TEMPLATE_RESULT have the same TREE_TYPE. It does indeed. But for a templated VAR_DECL with deduced non-dependent type, the two TREE_TYPEs end up diverging:

[PATCH 1/2] c++: modules and non-dependent auto deduction

2022-09-20 Thread Patrick Palka via Gcc-patches
The modules streaming code seems to rely on the invariant that a TEMPLATE_DECL and its DECL_TEMPLATE_RESULT have the same TREE_TYPE. But for a templated VAR_DECL with deduced non-dependent type, the two TREE_TYPEs end up diverging: cp_finish_decl deduces the type of the initializer ahead of time