For inheriting constructors which have to be emitted inline, we use CodeGenFunction::EmitInlinedInheritingCXXConstructorCall to emit the required code. This code uses EmitParmDecl to emit the "this" argument of the call. EmitParmDecl then helpfully calls llvm::Value::setName to name the parameter... which renames the global variable to "this".
To fix the issue, skip the setName call on globals.
The renaming still has slightly weird results in other cases (it renames all local variables initialized with an inlined inheriting constructor to "this"), but the result isn't actually wrong in those cases, so I'm just going to leave it for now.
Is it feasible to only set the name if the value doesn't already have a name, or do we give values bad names often enough that it's better to overwrite an existing name here?