================ @@ -1703,7 +1703,7 @@ namespace { bool checkNullPointerDiagnosingWith(const GenDiagType &GenDiag) { if (Designator.Invalid) return false; - if (IsNullPtr) { + if (getLValueBase().isNull()) { ---------------- zygoloid wrote:
Oh, I see. We're adjusting the offset *before* we call `addDecl`. I think this would be better fixed by reversing the order in which we do those steps -- first `addDecl` and then adjust the offset. A null base isn't necessarily a null pointer, so checking for a null base here seems wrong (but only in the weird case of a zero integer cast to a non-null pointer value, which we should only accept in constant-folding mode, not when properly evaluating). https://github.com/llvm/llvm-project/pull/113885 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits