[clang] [Clang] Fix 'counted_by' for nested struct pointers (PR #110497)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 14:29:48 PDT 2024


https://github.com/efriedma-quic commented:

StructAccessBase has two possible results: it finds an lvalue that's the base, which can't be peeled apart any further, or it finds a pointer that's the base.  It shouldn't be possible to confuse a pointer with a MemberExpr: a MemberExpr is an lvalue, and a pointer is, in this context, an rvalue.

So I think the issue here is that StructAccessBase is returning the wrong result, and trying to paper over that is going to lead to issues that are harder to track down later.

https://github.com/llvm/llvm-project/pull/110497


More information about the cfe-commits mailing list