Skip to content

Regression in clang 16 -frelaxed-template-template-args support to alias templates. #63281

Open
@mawww

Description

@mawww
template<typename T, int I = 0>
struct A {};

template<typename T, int I = 0>
using B = A<T, I>; 

template<template <typename> typename T>
void g() {}

void f() {
    g<A>();
    g<B>();
}

fails to compile on Clang 16 (using -frelaxed-template-template-args) with the following error:

<source>:12:5: error: no matching function for call to 'g'
    g<B>();
    ^~~~
<source>:8:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T'
void g() {}
     ^

The same code compiles on Clang 15. Removing -frelaxed-template-template-args makes that code fail in both Clang 15 and 16 and also complains about g<A>() with the same error.

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions