Skip to content

[clang] template template argument has different template parameters #95732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bobby3605 opened this issue Jun 17, 2024 · 2 comments
Closed

[clang] template template argument has different template parameters #95732

bobby3605 opened this issue Jun 17, 2024 · 2 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@bobby3605
Copy link

bobby3605 commented Jun 17, 2024

I'm trying to make a class that takes a container that takes a template as a template parameter for the class.
The following compiles in gcc, but not clang on 18.1.0. Clang trunk gives a different compilation error, which I am creating a separate issue for.
https://godbolt.org/z/j7cn3rd59
My guess is that it has something to do with the fact that std::vector takes two template arguments, one for the type, and one for the allocator. However, std::vector has a default argument for the allocator, so it only needs a single argument, but clang doesn't detect that.

@github-actions github-actions bot added the clang Clang issues not falling into any other category label Jun 17, 2024
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed clang Clang issues not falling into any other category labels Jun 17, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 17, 2024

@llvm/issue-subscribers-clang-frontend

Author: bobby3605 (bobby3605)

I'm trying to make a class that takes a container that takes a template as a template parameter for the class. The following compiles in gcc, but not clang on 18.1.0. Clang trunk gives a different compilation error, which I am creating a separate [issue](https://github.com//issues/95733) for. https://godbolt.org/z/j7cn3rd59 My guess is that it has something to do with the fact that std::vector takes two template arguments, one for the type, and one for the allocator. However, std::vector has a default argument for the allocator, so it only needs a single argument, but clang doesn't detect that.

@cor3ntin
Copy link
Contributor

Fixed in trunk (Clang 19) or with -frelaxed-template-template-args https://godbolt.org/z/1Kah8zKGT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

4 participants