https://github.com/zygoloid commented:

If we're going to the effort to customize this note, it seems a bit sad that 
we're still leaving in the implementation-detail, fabricated names. On 
reflection, tackling just a single note that mentions these names seems a bit 
narrow too. So I have a different suggestion, which I'm afraid would mean a 
completely different code change, but I think would be a better solution for 
the overall problem:

Add a new kind of `DeclarationName` for synthesized variables. (Just an enum of 
the various kinds of synthesized variable we support would do, though add a 
counter to disambiguate if you want.) Make the pretty-printing for that name 
produce something that explains what it *is*, eg `<for loop range>`, `<for loop 
iterator>`, `<for loop sentinel>`, rather than a synthetic identifier. (We'll 
still want to synthesize an identifier for debug info, but we can put that 
special case in the debug info logic.)

That would address *all* diagnostics that refer to these things, and would give 
us an easy path to apply the same fix to other kinds of synthesized variables.

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

Reply via email to