================
@@ -369,6 +387,18 @@ void 
UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
   maybeIssueFixes(Ctx, Diagnostic);
 }
 
+void UnnecessaryCopyInitialization::diagnoseCopyFromConstLocalVarMember(
+    const CheckContext &Ctx, const VarDecl &OldVar) {
+  auto Diagnostic =
+      diag(Ctx.Var.getLocation(),
+           "local copy %1 of the field of the variable %0 is never "
----------------
localspook wrote:

I think the error message would be more understandable if it mentioned the name 
of the field. Something like:
```txt
local copy 'foo' of the field 'bar' of the variable 'baz' is never modified 
[...]
                              ^^^^^
```
or:
```txt
local copy 'foo' of the subobject 'baz.bar' is never modified [...]
                        ^^^^^^^^^^^^^^^^^^^
```

https://github.com/llvm/llvm-project/pull/151936
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to