Should clang warn about partial specialization after instantiation?
| Bugzilla Link | 25367 |
| Version | unspecified |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
| CC | @zygoloid |
Extended Description
In the code below, T2<int,int> will not have mytype member, as T2<int,int> is first instantiated in line 2 and then T2<T,int> specialized in line 3.
1 template <typename T, typename> struct T2 {};
2 template struct T2<int, int>;
3 template
If we swap lines 2 and 3, T2<int,int> will have mytype as T2<int,int> will find and use the specialization T2<T,int>.
Similar to error: explicit specialization after instantiation, should we error or warn about this, a specialization that would have changed existing instantiation if it would have come before it?
@llvm/issue-subscribers-c-1
Related: #21530