Repository navigation
Conversation
TypeBuilder::buildArray calls populate(ConstantExprInfo<std::uint64_t>&,
clang::Expr const*) for dependent-sized arrays, but its definition lives in
ASTVisitor.cpp and only the three-argument overload is explicitly
instantiated there. The two-argument one is emitted only as an implicit
instantiation from the three-argument body, so when the compiler inlines
it the symbol is missing and linking tools/mrdocs fails:
Undefined symbols for architecture arm64:
"void mrdocs::ASTVisitor::populate<unsigned long long>(
mrdocs::ConstantExprInfo<unsigned long long>&, clang::Expr const*)"
This happens building against Homebrew's LLVM 23.1.2 on macOS arm64 at -O3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| Scope | Lines Δ% | Lines Δ | Lines + | Lines - | Files Δ | Files + | Files ~ | Files ↔ | Files - |
|---|---|---|---|---|---|---|---|---|---|
| 🛠️ Source | 100% | 7 | 7 | - | 1 | - | 1 | - | - |
| Total | 100% | 7 | 7 | - | 1 | - | 1 | - | - |
Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)
🔝 Top Files
- src/mrdocs/AST/ASTVisitor.cpp (Source): 7 lines Δ (+7 / -0)
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused instantiation correctly addresses the reported linker failure without changing runtime behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the missing explicit template instantiation needed to prevent optimized macOS arm64 link failures.
Changes:
- Explicitly instantiates the two-argument
populate<std::uint64_t>overload.
| File | Description |
|---|---|
src/mrdocs/AST/ASTVisitor.cpp |
Ensures the required template specialization emits a linkable symbol. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
An automated preview of the documentation is available at https://1334.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-10-04 07:47:26 UTC |
TypeBuilder::buildArraycallsASTVisitor::populate(ConstantExprInfo<std::uint64_t>&, clang::Expr const*)forDependentSizedArrayType. That template is defined inASTVisitor.cpp, but only the three-argument overload (..., llvm::APInt const&) is explicitly instantiated there. The two-argument one exists in the object file only as an implicit instantiation from the three-argument body. When the compiler inlines that call, no symbol is emitted, and linkingtools/mrdocsfails:I hit this building 2026.9.29 (Release,
-O3) on macOS arm64 against Homebrew'sllvm23.1.2, for a Homebrew formula. The pinned LLVM build happens not to inline the call, which is why CI doesn't see it.Changes
populate<std::uint64_t>insrc/mrdocs/AST/ASTVisitor.cpp.Testing
With this change, the configuration above builds and links, and
mrdocsgenerates documentation for a sample project. There's no new test: the failure only shows up at link time with a toolchain that inlines the call, and none of the CI toolchains do.Documentation
None needed; this is a build fix with no user-visible behavior change.
🤖 Generated with Claude Code