File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1193,6 +1193,34 @@ populate(
1193
1193
populate (Template.Args , CTSD->getTemplateArgs ().asArray ());
1194
1194
}
1195
1195
1196
+ // Extract requires clause from SFINAE context
1197
+ for (auto it = Template.Args .begin (); it != Template.Args .end ();)
1198
+ {
1199
+ auto & arg = *it;
1200
+ if (!arg)
1201
+ {
1202
+ ++it;
1203
+ continue ;
1204
+ }
1205
+ if (auto * T = dynamic_cast <TypeTArg*>(arg.get ());
1206
+ T &&
1207
+ T->Type &&
1208
+ !T->Type ->Constraints .empty ())
1209
+ {
1210
+ for (ExprInfo const & constraint: T->Type ->Constraints )
1211
+ {
1212
+ if (!Template.Requires .Written .empty ())
1213
+ {
1214
+ Template.Requires .Written += " && " ;
1215
+ }
1216
+ Template.Requires .Written += constraint.Written ;
1217
+ }
1218
+ it = Template.Args .erase (it);
1219
+ continue ;
1220
+ }
1221
+ ++it;
1222
+ }
1223
+
1196
1224
// Extract the template parameters if this is a partial specialization
1197
1225
if (auto * CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(CTSD))
1198
1226
{
You can’t perform that action at this time.
0 commit comments