string_view_test.cc
46.3 KB
-
LSC: Fix null safety issues diagnosed by Clang’s `-Wnonnull` and `-Wnullability`. · f555f69b
**Note**: These changes are generated by hand. Review with care. This CL changes the `absl_internal` implementations of `AsciiStrToLower()` / `AsciiStrToUpper()` to allow `src` to be null. This can, in fact, happen if the `string_view` passed to the public API is empty, and the implementations handle it correctly. I have added comments noting that `src` is allowed to be null iff the size is zero. `-Wnonnull` diagnoses cases where a `nullptr` literal is passed to a parameter annotated nonnull, or where `nullptr` is returned from a function whose return type is annotated nonnull. `-Wnullability` diagnoses cases where nullability annotations conflict, for example between the declaration and definition of a function. PiperOrigin-RevId: 673846759 Change-Id: I6cf3490ce13837eba9814156c420598000ecc596
Martin Brænne committed