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(
872872 }
873873 else
874874 {
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+
875889 // Iterate I.Params to find trailing requires clauses
876890 for (auto it = I.Params .begin (); it != I.Params .end (); )
877891 {
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ Declared in `<libcxx.cpp>`
3131----
3232template<typename T>
3333T
34- sqrt(T value);
34+ sqrt(T value)
35+ requires std::is_integral_v<T>;
3536----
3637
3738=== Description
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ <h3>Synopsis</h3>
4141< code class ="source-code cpp ">
4242template<typename T>
4343T
44- sqrt(T value);
44+ sqrt(T value)
45+ requires std::is_integral_v<T>;
4546</ code >
4647</ pre >
4748</ div >
Original file line number Diff line number Diff line change 44<namespace id =" //////////////////////////8=" >
55 <template >
66 <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=" >
88 <file short-path =" libcxx.cpp" source-path =" libcxx.cpp" line =" 149" />
99 <return >
1010 <type name =" T" />
Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ Declared in `<sfinae.cpp>`
246246----
247247template<class T>
248248T
249- f1(T value);
249+ f1(T value)
250+ requires std::is_integral_v<T>;
250251----
251252
252253[#f10]
@@ -294,7 +295,8 @@ Declared in `<sfinae.cpp>`
294295----
295296template<class T>
296297int
297- f2(T value);
298+ f2(T value)
299+ requires std::is_integral_v<T>;
298300----
299301
300302[#f3]
@@ -312,7 +314,8 @@ Declared in `<sfinae.cpp>`
312314----
313315template<class T>
314316<<B,B>>::<<B-C,C>>
315- f3(T value);
317+ f3(T value)
318+ requires std::is_integral_v<T>;
316319----
317320
318321[#f4]
@@ -330,7 +333,8 @@ Declared in `<sfinae.cpp>`
330333----
331334template<class T>
332335T
333- f4(T value);
336+ f4(T value)
337+ requires std::is_integral_v<T>;
334338----
335339
336340[#f5]
Original file line number Diff line number Diff line change @@ -290,7 +290,8 @@ <h3>Synopsis</h3>
290290< code class ="source-code cpp ">
291291template<class T>
292292T
293- f1(T value);
293+ f1(T value)
294+ requires std::is_integral_v<T>;
294295</ code >
295296</ pre >
296297</ div >
@@ -343,7 +344,8 @@ <h3>Synopsis</h3>
343344< code class ="source-code cpp ">
344345template<class T>
345346int
346- f2(T value);
347+ f2(T value)
348+ requires std::is_integral_v<T>;
347349</ code >
348350</ pre >
349351</ div >
@@ -365,7 +367,8 @@ <h3>Synopsis</h3>
365367< code class ="source-code cpp ">
366368template<class T>
367369< 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>;
369372</ code >
370373</ pre >
371374</ div >
@@ -387,7 +390,8 @@ <h3>Synopsis</h3>
387390< code class ="source-code cpp ">
388391template<class T>
389392T
390- f4(T value);
393+ f4(T value)
394+ requires std::is_integral_v<T>;
391395</ code >
392396</ pre >
393397</ div >
Original file line number Diff line number Diff line change 44<namespace id =" //////////////////////////8=" >
55 <template >
66 <tparam name =" T" class =" type" />
7- <function name =" f1" id =" Bs19YS1cqZhrsbv149xgnjRFUAk=" >
7+ <function name =" f1" requires = " std::is_integral_v < T > " id =" Bs19YS1cqZhrsbv149xgnjRFUAk=" >
88 <file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 5" />
99 <return >
1010 <type name =" T" />
2121 </template >
2222 <template >
2323 <tparam name =" T" class =" type" />
24- <function name =" f2" id =" uckUKgu5WdbIitoodkl2kXQ7RWI=" >
24+ <function name =" f2" requires = " std::is_integral_v < T > " id =" uckUKgu5WdbIitoodkl2kXQ7RWI=" >
2525 <file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 10" />
2626 <return >
2727 <type name =" int" />
4343 </namespace >
4444 <template >
4545 <tparam name =" T" class =" type" />
46- <function name =" f3" id =" HIZ4NeNKvHJFhj0tJIjpjaLL30U=" >
46+ <function name =" f3" requires = " std::is_integral_v < T > " id =" HIZ4NeNKvHJFhj0tJIjpjaLL30U=" >
4747 <file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 19" />
4848 <return >
4949 <type id =" r/5vKTgl4cXSK5TnuZ/+P7qmkJ0=" name =" B::C" />
6060 </template >
6161 <template >
6262 <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=" >
6464 <file short-path =" sfinae.cpp" source-path =" sfinae.cpp" line =" 24" />
6565 <return >
6666 <type name =" T" />
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ Declared in `<sqrt.cpp>`
3131----
3232template<typename T>
3333T
34- sqrt(T value);
34+ sqrt(T value)
35+ requires std::is_integral_v<T>;
3536----
3637
3738=== Description
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ <h3>Synopsis</h3>
4141< code class ="source-code cpp ">
4242template<typename T>
4343T
44- sqrt(T value);
44+ sqrt(T value)
45+ requires std::is_integral_v<T>;
4546</ code >
4647</ pre >
4748</ div >
Original file line number Diff line number Diff line change 44<namespace id =" //////////////////////////8=" >
55 <template >
66 <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=" >
88 <file short-path =" sqrt.cpp" source-path =" sqrt.cpp" line =" 15" class =" def" />
99 <return >
1010 <type name =" T" />
You can’t perform that action at this time.
0 commit comments