https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102158
Bug ID: 102158
Summary: Specialized non-type template argument violates
[temp.spec.partial#general-9] but accepted by GCC
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: xmh970252187 at gmail dot com
Target Milestone: ---
template <class T, auto t,class...> struct C {};
template <class T> struct C<T, decltype(T{}){1024}>{
using type = T;
};
int main(){
C<int,1024>::type b = 12;
}
`decltype(T{}){1024}` is specialized, the type of corresponding template
parameter does dependent on the parameter of the partial specialization, which
violates [temp.spec.partial#general-9.1]
> The type of a template parameter corresponding to a specialized non-type
> argument shall not be dependent on a parameter of the partial specialization.