https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119401
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- The underlying problem is that we tsubst_lambda_expr three times for the same arguments, producing three different lambdas: 1) when forming the type of A<>::f 2) when forming the parameters of A<>::f 3) when instantiating A<>::f before r15-7202 we silently ended up with #3 and got the mangling wrong. But now they all have the same mangling, so they collide. The fix should be to only instantiate the lambda once, whether that's something specific to lambdas or more generally by only doing tsubst_arg_types/lookup_template_class once for B<...>.