AaronBallman wrote: > The caller checkArithmeticOpPointerOperand already strips _Atomic for its own > checks but passes the original expression to the diagnostic function. The > sibling function checkArithmeticIncompletePointerType handles this correctly > by stripping _Atomic before the assertion.
I think a bit more investigation is needed; I would expect lvalue conversion to have already taken place by the time we're checking on arithmetic and so the types should be non-atomic by this point. However, I suspect we're passing the original type so that we get better diagnostic behavior in some cases. I wonder if it would make more sense to split the "require the original type" checks out into their own functions and pass the actual type used for arithmetic to the usual "check" functions so we can stop sprinkling type adjustments everywhere. WDYT? https://github.com/llvm/llvm-project/pull/228255 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
