You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang] Changes to template argument list checking
Implement some missing changes to support checking of argument-side template parameter
packs matching parameter-side non-pack parameters, which are required to
support non-exact matches in these cases, and applies appropriate
conversions which help deducing NTTPs of placeholder types.
template <int ...N> // expected-error{{deduced non-type template argument does not have the same type as the corresponding template parameter ('int' vs 'long')}}
21
+
template <int ...N> // expected-error{{deduced non-type template argument does not have the same type as the corresponding template parameter ('int' vs 'void *')}}
22
22
classTT// expected-note {{previous template template parameter is here}}
23
23
> structX0 { };
24
24
25
25
template<int I, int J, int ...Rest> structX0a;
26
26
template<int ...Rest> structX0b;
27
-
template<int I, long J> structX0c; // expected-note{{template parameter is declared here}}
27
+
template<int I, long J> structX0c;
28
+
template<int I, short J> structX0d;
29
+
template<int I, void *J> structX0e; // expected-note{{template parameter is declared here}}
28
30
29
31
X0<X0a> inst_x0a;
30
32
X0<X0b> inst_x0b;
31
-
X0<X0c> inst_x0c; // expected-note{{template template argument has different template parameters than its corresponding template template parameter}}
33
+
X0<X0c> inst_x0c;
34
+
X0<X0d> inst_x0d;
35
+
X0<X0e> inst_x0e; // expected-note{{template template argument has different template parameters than its corresponding template template parameter}}
32
36
33
37
template<typename T,
34
-
template <T ...N> // expected-error{{deduced non-type template argument does not have the same type as the corresponding template parameter ('short' vs 'long')}}
38
+
template <T ...N> // expected-error{{deduced non-type template argument does not have the same type as the corresponding template parameter ('short' vs 'void *')}}
35
39
classTT// expected-note {{previous template template parameter is here}}
36
40
> structX1 { };
41
+
37
42
template<int I, int J, int ...Rest> structX1a;
38
43
template<long I, long ...Rest> structX1b;
39
44
template<short I, short J> structX1c;
40
-
template<short I, long J> structX1d; // expected-note{{template parameter is declared here}}
45
+
template<short I, long J> structX1d;
46
+
template<short I, void *J> structX1e; // expected-note{{template parameter is declared here}}
41
47
42
48
X1<int, X1a> inst_x1a;
43
49
X1<long, X1b> inst_x1b;
44
50
X1<short, X1c> inst_x1c;
45
-
X1<short, X1d> inst_x1d; // expected-note{{template template argument has different template parameters than its corresponding template template parameter}}
51
+
X1<short, X1d> inst_sx1d;
52
+
X1<int, X1d> inst_ix1d;
53
+
X1<short, X1e> inst_x1e; // expected-note{{template template argument has different template parameters than its corresponding template template parameter}}
46
54
47
55
template <int> classX2; // expected-note{{template is declared here}} \
0 commit comments