nullability.h
12.2 KB
-
Add nullability attributes to nullability type aliases. · 485f2be7
This is a followup to the [previous change](https://github.com/abseil/abseil-cpp/commit/69195d5bd2416a7224416887c78353ee8edf67ee) that added the `ABSL_NULLABILITY_COMPATIBLE` attribute macro. Adding these attributes has the following benefits: - Clang itself can now diagnose certain nullability errors through the `-Wnonnull` and `-Wnullability` warnings. - The nullability annotations can now also be used on pointers to incomplete types, as we have removed the `IsSupportedType` mechanism that used the `absl_nullability_compatible` tag to check whether a type is nullability-compatible (which only worked for complete types) and instead let Clang perform this check through the `ABSL_NULLABILITY_COMPATIBLE` attribute (which also works on incomplete types). PiperOrigin-RevId: 684342145 Change-Id: I94c8affd5be704cb49340058ced177f09ebd83a3
Martin Brænne committed