Skip to content

Conversation

@zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Dec 6, 2025

Allow passing a C++ template as a template template argument to another C++ template. Does not allow passing a Carbon generic as an argument.

Depends on #6474.

@zygoloid zygoloid requested a review from a team as a code owner December 6, 2025 22:21
@zygoloid zygoloid added the dependent Depends on another issue/PR label Dec 6, 2025
@zygoloid zygoloid requested review from chandlerc and removed request for a team December 6, 2025 22:21
@zygoloid zygoloid changed the title Add support for template template parameters. Support for passing C++ templates as arguments to template template parameters. Dec 6, 2025
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Minor comment suggesting a potential place we might want another TODO, but nothing substantive and optional if it doesn't actually make sense.

Super nice change overall!

Comment on lines 51 to 53
// Synthesize a placeholder `void{}` template argument, that will never be a
// valid argument for any template parameter. This is used in order to get Clang
// to diagnose invalid template argument errors for us.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add that this will map this void{} argument's source location to the Carbon argument's source location?

It's a bit of an implementation detail, but key to making the diagnostic effective.

Also, would it make sense to flag this as a candidate for an extension point in Clang so that even when the void{} is printed within the diagnostic text it can either call back into Carbon to print the expression or at least say something like <Carbon placeholder expression> instead of void{}? If so, maybe a TODO? Not looking to do more than the current code does in this PR, just to record that we could go further here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@zygoloid zygoloid force-pushed the toolchain-interop-template-template-args branch from b18013e to 5fcfccf Compare December 16, 2025 18:26
@zygoloid zygoloid enabled auto-merge December 16, 2025 18:27
@zygoloid zygoloid added this pull request to the merge queue Dec 16, 2025
Merged via the queue into carbon-language:trunk with commit 2e65d28 Dec 16, 2025
8 checks passed
@zygoloid zygoloid deleted the toolchain-interop-template-template-args branch December 16, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependent Depends on another issue/PR toolchain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants