Skip to main content

Module reconcile

Module reconcile 

Source
Expand description

Resolution-time identity reconciliation for C++ out-of-line member definitions (#1134).

A method nested inside a class that is itself inside a namespace – log4cxx::Outer::Inner::method – is declared in a header (indexed log4cxx.Outer$Inner.method: $ joins the class-nesting chain, the enclosing namespace is the package) and defined out-of-line in a .cpp (int Outer::Inner::method() const {...}). Per-file extraction cannot see the header’s class layout, so it must guess whether each qualifier segment (Outer, Inner) is a namespace or a class. Two shapes guess wrong (#1121 left them documented, not masked): a file-scope definition under a using namespace directive, and the template-specialization twin. Both are irreducibly class-table-dependent – the only signal that Outer is a class and not a namespace is the set of classes visible to the .cpp through its #include graph.

This module holds the pure decision: given the ordered owner segments of a definition’s qualifier, the candidate enclosing namespaces (the lexical package plus any in-scope using namespace targets), and a view of the include-visible class table, decide the one canonical (package, owner-chain, member) a visible class actually confirms – or refuse when nothing confirms or the confirmation is ambiguous. The function is analyzer-free and I/O-free so it can be unit-tested in isolation; the analyzer wiring that feeds it the real class table lives in the surrounding modules.

Structs§

ReconciledIdentity
The canonical identity a definition should unify under: the enclosing namespace (::-joined), the class-nesting chain ($-joined short name), and the member name.
VisibleClass
A minimal, testable view of one class visible to a file through its #include graph: its enclosing namespace (::-joined, empty at global scope) and its class-nesting chain as Bifrost’s $-joined short name (Outer$Inner for Outer::Inner, Klass for a non-nested class).

Functions§

reconcile_out_of_line_member_identity
Decide the canonical identity of an out-of-line member definition from its qualifier segments and the include-visible class table.