================ @@ -132,6 +132,18 @@ const Expr *bugreporter::getDerefExpr(const Stmt *S) { } // Pattern match for a few useful cases: a[0], p->f, *p etc. else if (const auto *ME = dyn_cast<MemberExpr>(E)) { + // This handles the case when the dereferencing of a member reference + // happens. This is needed, because the ast for dereferencing of a + // member reference looks like the following: + // |-MemberExpr + // `-DeclRefExpr + // This branch without the special case just takes out the DeclRefExpr + // of the struct, class or union. + // This is wrong, because this DeclRefExpr will be passed + // to the bug reporting and the notes will refer to wrong variable + // (the struct instead of the member). ---------------- DonatNagyE wrote:
```suggestion // Without this special case the notes would refer to the whole object // (struct, class or union variable) instead of just the relevant member. ``` https://github.com/llvm/llvm-project/pull/68691 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits