Landing: d566a83a7942

Project / Subsystem

gcc / c++/modules

Date

2026-04-27

Author

Patrick Palka

Commit

d566a83a79424ef6444960ae79bab90ed76ad8e2

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++/modules
patch_id
commit_hash
d566a83a79424ef6444960ae79bab90ed76ad8e2
source_type
github
headline
Defer completion of streamed-in cNTTPs in C++ modules
tldr
This commit defers the completion of streamed-in constant non-type template parameters (cNTTPs) in C++ modules to avoid lazy loading recursion.
author
Patrick Palka
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • modules
  • templates
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-04-27T00:00:00.000Z

This commit addresses a lazy loading recursion issue encountered when streaming in constant non-type template parameters (cNTTPs) in C++ modules. The issue arose because the class definition of involved template parameters might not have been streamed in yet. To resolve this, the commit defers calling cp_finish_decl for NTTP objects until after lazy loading has completed, mirroring the approach used for expand_or_defer_fn and constructors. This change ensures correct handling of cNTTPs in C++ modules.