| Issue |
58124
|
| Summary |
Out-of-class definition of member of constrained specialization
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
jwakely
|
```c++
template<class T> concept C1 = true;
template<class T> concept C2 = C1<T> && true;
template<C1> struct X { };
template<C2 T> struct X<T> { struct Y; };
template<C2 T> struct X<T>::Y { }; // (1)
```
Clang rejects (1) saying:
```
<source>:7:10: error: type constraint differs in template redeclaration
template<C2 T> struct X<T>::Y { };
^
<source>:4:10: note: previous template declaration is here
template<C1 T> struct X { };
^
<source>:7:29: error: no struct named 'Y' in 'X<T>'
template<C2 T> struct X<T>::Y { };
~~~~~~^
```
This is wrong, `Y` is a member of the partial specialization on line 5, not the primary template on line 4.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs