================ @@ -15534,17 +15534,28 @@ void Sema::AddPotentialMisalignedMembers(Expr *E, RecordDecl *RD, ValueDecl *MD, MisalignedMembers.emplace_back(E, RD, MD, Alignment); } -void Sema::DiagnoseMisalignedMembers() { - for (MisalignedMember &m : MisalignedMembers) { - const NamedDecl *ND = m.RD; +void Sema::DiagnoseMisalignedMembers(const Expr *E) { + // Only emit diagnostics related to the current expression. + const auto *EmitFrom = MisalignedMembers.begin(); + if (E->getSourceRange().isValid()) { ---------------- erichkeane wrote:
This is not really a valid way to do this, all of the checking source locations isn't really something Sema should be doing. How exactly is this trying to work? It seems that the diagnostic you're trying to skip actually lloks valid, and I don't see how looking at source locations helps? https://github.com/llvm/llvm-project/pull/150025 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits