Skip to content

Fix lowering of imported global variables.#6567

Merged
zygoloid merged 2 commits intocarbon-language:trunkfrom
zygoloid:toolchain-var-template
Jan 11, 2026
Merged

Fix lowering of imported global variables.#6567
zygoloid merged 2 commits intocarbon-language:trunkfrom
zygoloid:toolchain-var-template

Conversation

@zygoloid
Copy link
Copy Markdown
Contributor

@zygoloid zygoloid commented Jan 8, 2026

  • When a C++ static data member is imported, evaluate its address to a
    constant like we would for a namespace-scope variable.
  • When an imported variable is used in a way that doesn't require its
    type to be complete, emit the variable with an opaque type instead
    of skipping it (and potentially crashing later).

*   When a C++ static data member is imported, evaluate its address to a
    constant like we would for a namespace-scope variable.
*   When an imported variable is used in a way that doesn't require its
    type to be complete, emit the variable with an opaque type instead
    of skipping it (and potentially crashing later).
@zygoloid zygoloid requested a review from a team as a code owner January 8, 2026 23:46
@zygoloid zygoloid requested review from danakj and removed request for a team January 8, 2026 23:46
Copy link
Copy Markdown
Contributor

@danakj danakj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zygoloid zygoloid force-pushed the toolchain-var-template branch 2 times, most recently from d61fbbb to 82ac7d0 Compare January 9, 2026 02:45
@zygoloid zygoloid force-pushed the toolchain-var-template branch from 82ac7d0 to 3759f1d Compare January 9, 2026 02:47
@zygoloid zygoloid added this pull request to the merge queue Jan 11, 2026
Merged via the queue into carbon-language:trunk with commit 935ccce Jan 11, 2026
8 checks passed
@zygoloid zygoloid deleted the toolchain-var-template branch January 11, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants