Are there other cases where idiomatic C++ might lead to such an indirect suggestion being appropriate for accessing the field?
(std::tuple, I suppose, but I'm not sure how often that would arise in practice...)
Having some modest compilers knowledge, I'm already impressed that the first use case is possible. It's already covering many uses cases where people use simple Getters, so thanks for the work.
Yes returning std::tuples of an object state or something might be a valid use case, but as you say, I'm not sure how often this would occur!
Sadly, gcc 8 isn't smart enough to do that yet; I only implemented it for simple "return name_of_field;" accessors.
But it's an interesting idea, which I've filed as: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84895 - thanks.
Are there other cases where idiomatic C++ might lead to such an indirect suggestion being appropriate for accessing the field? (std::tuple, I suppose, but I'm not sure how often that would arise in practice...)