File tree Expand file tree Collapse file tree 10 files changed +44
-18
lines changed Expand file tree Collapse file tree 10 files changed +44
-18
lines changed Original file line number Diff line number Diff line change @@ -872,6 +872,20 @@ populate(
872
872
}
873
873
else
874
874
{
875
+ // Return type SFINAE constraints
876
+ if (I.ReturnType &&
877
+ !I.ReturnType ->Constraints .empty ())
878
+ {
879
+ for (ExprInfo const & constraint: I.ReturnType ->Constraints )
880
+ {
881
+ if (!I.Requires .Written .empty ())
882
+ {
883
+ I.Requires .Written += " && " ;
884
+ }
885
+ I.Requires .Written += constraint.Written ;
886
+ }
887
+ }
888
+
875
889
// Iterate I.Params to find trailing requires clauses
876
890
for (auto it = I.Params .begin (); it != I.Params .end (); )
877
891
{
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ Declared in `<libcxx.cpp>`
31
31
----
32
32
template<typename T>
33
33
T
34
- sqrt(T value);
34
+ sqrt(T value)
35
+ requires std::is_integral_v<T>;
35
36
----
36
37
37
38
=== Description
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ <h3>Synopsis</h3>
41
41
< code class ="source-code cpp ">
42
42
template<typename T>
43
43
T
44
- sqrt(T value);
44
+ sqrt(T value)
45
+ requires std::is_integral_v<T>;
45
46
</ code >
46
47
</ pre >
47
48
</ div >
Original file line number Diff line number Diff line change 4
4
<namespace id =" //////////////////////////8=" >
5
5
<template >
6
6
<tparam name =" T" class =" type" />
7
- <function name =" sqrt" id =" ulFDUE1svTCX8fV/h8EIp4NNbWs=" >
7
+ <function name =" sqrt" requires = " std::is_integral_v < T > " id =" ulFDUE1svTCX8fV/h8EIp4NNbWs=" >
8
8
<file short-path =" libcxx.cpp" source-path =" libcxx.cpp" line =" 149" />
9
9
<return >
10
10
<type name =" T" />
Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ Declared in `<sfinae.cpp>`
246
246
----
247
247
template<class T>
248
248
T
249
- f1(T value);
249
+ f1(T value)
250
+ requires std::is_integral_v<T>;
250
251
----
251
252
252
253
[#f10]
@@ -294,7 +295,8 @@ Declared in `<sfinae.cpp>`
294
295
----
295
296
template<class T>
296
297
int
297
- f2(T value);
298
+ f2(T value)
299
+ requires std::is_integral_v<T>;
298
300
----
299
301
300
302
[#f3]
@@ -312,7 +314,8 @@ Declared in `<sfinae.cpp>`
312
314
----
313
315
template<class T>
314
316
<<B,B>>::<<B-C,C>>
315
- f3(T value);
317
+ f3(T value)
318
+ requires std::is_integral_v<T>;
316
319
----
317
320
318
321
[#f4]
@@ -330,7 +333,8 @@ Declared in `<sfinae.cpp>`
330
333
----
331
334
template<class T>
332
335
T
333
- f4(T value);
336
+ f4(T value)
337
+ requires std::is_integral_v<T>;
334
338
----
335
339
336
340
[#f5]
Original file line number Diff line number Diff line change @@ -290,7 +290,8 @@ <h3>Synopsis</h3>
290
290
< code class ="source-code cpp ">
291
291
template<class T>
292
292
T
293
- f1(T value);
293
+ f1(T value)
294
+ requires std::is_integral_v<T>;
294
295
</ code >
295
296
</ pre >
296
297
</ div >
@@ -343,7 +344,8 @@ <h3>Synopsis</h3>
343
344
< code class ="source-code cpp ">
344
345
template<class T>
345
346
int
346
- f2(T value);
347
+ f2(T value)
348
+ requires std::is_integral_v<T>;
347
349
</ code >
348
350
</ pre >
349
351
</ div >
@@ -365,7 +367,8 @@ <h3>Synopsis</h3>
365
367
< code class ="source-code cpp ">
366
368
template<class T>
367
369
< a href ="#B "> B</ a > ::< a href ="#B-C "> C</ a >
368
- f3(T value);
370
+ f3(T value)
371
+ requires std::is_integral_v<T>;
369
372
</ code >
370
373
</ pre >
371
374
</ div >
@@ -387,7 +390,8 @@ <h3>Synopsis</h3>
387
390
< code class ="source-code cpp ">
388
391
template<class T>
389
392
T
390
- f4(T value);
393
+ f4(T value)
394
+ requires std::is_integral_v<T>;
391
395
</ code >
392
396
</ pre >
393
397
</ div >
Original file line number Diff line number Diff line change 4
4
<namespace id =" //////////////////////////8=" >
5
5
<template >
6
6
<tparam name =" T" class =" type" />
7
- <function name =" f1" id =" Bs19YS1cqZhrsbv149xgnjRFUAk=" >
7
+ <function name =" f1" requires = " std::is_integral_v < T > " id =" Bs19YS1cqZhrsbv149xgnjRFUAk=" >
8
8
<file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 5" />
9
9
<return >
10
10
<type name =" T" />
21
21
</template >
22
22
<template >
23
23
<tparam name =" T" class =" type" />
24
- <function name =" f2" id =" uckUKgu5WdbIitoodkl2kXQ7RWI=" >
24
+ <function name =" f2" requires = " std::is_integral_v < T > " id =" uckUKgu5WdbIitoodkl2kXQ7RWI=" >
25
25
<file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 10" />
26
26
<return >
27
27
<type name =" int" />
43
43
</namespace >
44
44
<template >
45
45
<tparam name =" T" class =" type" />
46
- <function name =" f3" id =" HIZ4NeNKvHJFhj0tJIjpjaLL30U=" >
46
+ <function name =" f3" requires = " std::is_integral_v < T > " id =" HIZ4NeNKvHJFhj0tJIjpjaLL30U=" >
47
47
<file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 19" />
48
48
<return >
49
49
<type id =" r/5vKTgl4cXSK5TnuZ/+P7qmkJ0=" name =" B::C" />
60
60
</template >
61
61
<template >
62
62
<tparam name =" T" class =" type" />
63
- <function name =" f4" id =" 45LJB0/nCsN3KRlVtnRqNrJG818=" >
63
+ <function name =" f4" requires = " std::is_integral_v < T > " id =" 45LJB0/nCsN3KRlVtnRqNrJG818=" >
64
64
<file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 24" />
65
65
<return >
66
66
<type name =" T" />
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ Declared in `<sqrt.cpp>`
31
31
----
32
32
template<typename T>
33
33
T
34
- sqrt(T value);
34
+ sqrt(T value)
35
+ requires std::is_integral_v<T>;
35
36
----
36
37
37
38
=== Description
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ <h3>Synopsis</h3>
41
41
< code class ="source-code cpp ">
42
42
template<typename T>
43
43
T
44
- sqrt(T value);
44
+ sqrt(T value)
45
+ requires std::is_integral_v<T>;
45
46
</ code >
46
47
</ pre >
47
48
</ div >
Original file line number Diff line number Diff line change 4
4
<namespace id =" //////////////////////////8=" >
5
5
<template >
6
6
<tparam name =" T" class =" type" />
7
- <function name =" sqrt" id =" ulFDUE1svTCX8fV/h8EIp4NNbWs=" >
7
+ <function name =" sqrt" requires = " std::is_integral_v < T > " id =" ulFDUE1svTCX8fV/h8EIp4NNbWs=" >
8
8
<file short-path =" sqrt.cpp" source-path =" sqrt.cpp" line =" 15" class =" def" />
9
9
<return >
10
10
<type name =" T" />
You can’t perform that action at this time.
0 commit comments