Skip to content

Commit 5d86ea7

Browse files
committed
Fix: cpp1 genertion for is-constraints on wildcarded params
Closes hsutter#1229
1 parent 53b158d commit 5d86ea7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/to_cpp1.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -4613,9 +4613,11 @@ class cppfront
46134613
auto name = n.declaration->identifier->get_token();
46144614
assert(name);
46154615
auto req = print_to_string(*type_id.constraint);
4616-
req += "<CPP2_TYPEOF(";
4617-
req += *name;
4618-
req += ")>";
4616+
if (auto pos = req.find('<'); pos != req.npos) {
4617+
req.insert(pos+1, "CPP2_TYPEOF(" + name->to_string() + "), ");
4618+
} else {
4619+
req.append("<CPP2_TYPEOF("+ name->to_string() +")>");
4620+
}
46194621
function_requires_conditions.push_back(req);
46204622
}
46214623
}

0 commit comments

Comments
 (0)