[interop] Pass template names and named constants as template arguments - #62
Open
conrade-ctc wants to merge 2 commits into
Open
[interop] Pass template names and named constants as template arguments#62conrade-ctc wants to merge 2 commits into
conrade-ctc wants to merge 2 commits into
Conversation
is_integral rejects a leading minus, so the comma-split fallback in AppendTypesSlow reads a negative literal as a type name. Accept the sign. Co-developed-with-the-help-of: Claude Code (Opus 5, human in the loop)
conrade-ctc
force-pushed
the
pr-c-template-args
branch
from
September 1, 2026 20:24
c1d9ce3 to
1e9aef5
Compare
A class or alias template name becomes a template-template argument. The argument carries the name and a null type. A constexpr variable or an enum constant goes through as its qualified name, so Sema builds an expression. true and false become bool values. The by-name paths need a CppInterOp that resolves the name. An older one reads the name as an integer literal and instantiates a garbage value. Probe for CppInterOp's SupportsNamedTemplateArguments export, and skip the test when it is absent. Co-developed-with-the-help-of: Claude Code (Fable 5, human in the loop)
conrade-ctc
force-pushed
the
pr-c-template-args
branch
from
September 1, 2026 21:15
1e9aef5 to
5d9ceb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A template argument can now name a template or a constant. A class or alias template name becomes a template-template argument. A constexpr variable or an enum constant becomes an expression, so Sema reads its value.
trueandfalsebecome bool values. The first commit fixes a separate bug:is_integralrejected a leading minus, so a negative literal became a type name.The by-name paths need CppInterOp compiler-research/CppInterOp#1074, which resolves the name and exports a capability marker. cppjit probes for the marker and keeps the paths off when it is absent. The guarded test then skips.