In pointer nullability diagnosis, distinguish different kinds of diagnostics.
PiperOrigin-RevId: 549710060
Change-Id: I49ecafba4e91025b8b85f9b273dbd494d2622b1b
diff --git a/nullability/test/function_calls.cc b/nullability/test/function_calls.cc
index 5911e98..51b0b76 100644
--- a/nullability/test/function_calls.cc
+++ b/nullability/test/function_calls.cc
@@ -258,6 +258,17 @@
)cc"));
}
+TEST(PointerNullabilityTest, CallExprMultiNonnullParams) {
+ EXPECT_TRUE(checkDiagnostics(R"cc(
+ void take(int *_Nonnull, int *_Nullable, int *_Nonnull);
+ void target() {
+ take(nullptr, // [[unsafe]]
+ nullptr,
+ nullptr); // [[unsafe]]
+ }
+ )cc"));
+}
+
TEST(PointerNullabilityTest, CanOverwritePtrWithPtrCreatedFromRefReturnType) {
// Test that if we create a pointer from a function returning a reference, we
// can use that pointer to overwrite an existing nullable pointer and make it