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] Instantiate concepts with sugared template arguments
Since we don't unique specializations for concepts, we can just instantiate
them with the sugared template arguments, at negligible cost.
If we don't track their specializations, we can't resugar them later
anyway, and that would be more expensive than just instantiating them
sugared in the first place since it would require an additional pass.
Signed-off-by: Matheus Izvekov <[email protected]>
Differential Revision: https://reviews.llvm.org/D136566
Copy file name to clipboardExpand all lines: clang/test/CXX/expr/expr.prim/expr.prim.req/compound-requirement.cpp
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -35,14 +35,14 @@ using r2i2 = r2<A>; // expected-error{{constraints not satisfied for class templ
35
35
using r2i3 = r2<D>;
36
36
using r2i4 = r2<const D>; // expected-error{{constraints not satisfied for class template 'r2' [with T = const D]}}
37
37
38
-
template<typename T> requiresrequires { { sizeof(T) }; } // expected-note{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'void'}} expected-note{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'nonexistent'}}
38
+
template<typename T> requiresrequires { { sizeof(T) }; } // expected-note{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'void'}} expected-note{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'class nonexistent'}}
39
39
structr3 {};
40
40
41
41
using r3i1 = r3<int>;
42
42
using r3i2 = r3<A>;
43
43
using r3i3 = r3<A &>;
44
44
using r3i4 = r3<void>; // expected-error{{constraints not satisfied for class template 'r3' [with T = void]}}
45
-
using r3i4 = r3<classnonexistent>; // expected-error{{constraints not satisfied for class template 'r3' [with T = nonexistent]}}
45
+
using r3i4 = r3<classnonexistent>; // expected-error{{constraints not satisfied for class template 'r3' [with T = class nonexistent]}}
// expected-note@-1 {{because 'is_same_v<int, int *>' evaluated to false}}
152
+
// expected-note@-1 {{because 'is_same_v<int, typename T2::inner>' evaluated to false}}
153
153
154
154
static_assert(C1<int>);
155
155
static_assert(C1<int*>);
@@ -173,9 +173,9 @@ namespace std_example {
173
173
intoperator *() { return0; }
174
174
};
175
175
static_assert(C2<T1>);
176
-
template<C2 T> structC2_check {}; // expected-note{{because 'int' does not satisfy 'C2'}} expected-note{{because 'std_example::T2' does not satisfy 'C2'}}
176
+
template<C2 T> structC2_check {}; // expected-note{{because 'int' does not satisfy 'C2'}} expected-note{{because 'T2' does not satisfy 'C2'}}
177
177
using c2c1 = C2_check<int>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = int]}}
178
-
using c2c2 = C2_check<T2>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = std_example::T2]}}
178
+
using c2c2 = C2_check<T2>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = T2]}}
0 commit comments