[clang] Wrong class specialization is selected when alias template is used for template template parameter
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The second static assert in the following trivial example code fails due to incorrect class specialization being selected:
```C++
template class, class>
struct match_class_specialization
{
enum { matches = 0 };
};
template class Type, typename... Ts>
struct match_class_specialization>
{
enum { matches = 1 };
};
template struct my_type {};
static_assert(match_class_specialization>{}.matches);
template using my_type_alias = my_type;
static_assert(match_class_specialization>{}.matches);
int main() {}
```
This compiles fine in GCC.
Contributor guide
Research direction
Start with the minimal C++ reproducer in the issue and compile it with Clang, then compare the result with GCC. Trace the template-template-parameter and alias-template specialization selection involved in the failing second static assertion; done means the alias-template case selects the matching specialization and the assertion passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100