Open
Description
The following code doesn't compile on Clang 18 and further:
template<typename>
concept Constrained = true;
template <typename T>
class C
{
template<Constrained>
class D;
};
template <typename T>
template <Constrained>
class C<T>::D
{
};
With the following message:
<source>:12:11: error: type constraint differs in template redeclaration
12 | template <Constrained>
| ^
<source>:7:14: note: previous template declaration is here
7 | template<Constrained>
| ^
1 error generated.
It compiles with Clang 17, GCC and MSVC (https://godbolt.org/z/r65o8sPjs).