From 8461191b826654a30eaaa57257bcca8e548f11c2 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Wed, 1 Jul 2020 08:30:52 -0600 Subject: [PATCH] Adjust text of expected warnings changed in PR c++/86568. libstdc++-v3/ChangeLog: * testsuite/21_strings/basic_string_view/cons/char/nonnull.cc: Adjust text of expected warning. * testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc: Same. * testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc: Same. * testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc: Same. * testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc: Same. --- .../basic_string_view/cons/char/nonnull.cc | 6 +++--- .../basic_string_view/cons/wchar_t/nonnull.cc | 6 +++--- .../operations/compare/char/nonnull.cc | 4 ++-- .../operations/find/char/nonnull.cc | 12 ++++++------ .../operations/rfind/char/nonnull.cc | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/nonnull.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/nonnull.cc index dc93cd67a1f..81c6fc5d29a 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/nonnull.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/nonnull.cc @@ -23,7 +23,7 @@ void test01() { - std::string_view s((const char*)nullptr); // { dg-warning "null arg" } - std::string_view t((char*)nullptr); // { dg-warning "null arg" } - std::string_view u(nullptr); // { dg-warning "null arg" } + std::string_view s((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + std::string_view t((char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + std::string_view u(nullptr); // { dg-warning "\\\[-Wnonnull" } } diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc index ded89c2ce45..ce95884e5de 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc @@ -23,7 +23,7 @@ void test01() { - std::wstring_view s((const wchar_t*)nullptr); // { dg-warning "null arg" } - std::wstring_view t((wchar_t*)nullptr); // { dg-warning "null arg" } - std::wstring_view u(nullptr); // { dg-warning "null arg" } + std::wstring_view s((const wchar_t*)nullptr); // { dg-warning "\\\[-Wnonnull" } + std::wstring_view t((wchar_t*)nullptr); // { dg-warning "\\\[-Wnonnull" } + std::wstring_view u(nullptr); // { dg-warning "\\\[-Wnonnull" } } diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc index 0deba716ed3..7060ffb0109 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc @@ -24,6 +24,6 @@ int test01() { std::string_view s = "abcd"; - return s.compare((const char*)nullptr); // { dg-warning "null arg" } - return s.compare(0, 2, (const char*)nullptr); // { dg-warning "null arg" } + return s.compare((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + return s.compare(0, 2, (const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } } diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc index d097866b704..97c7629d388 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc @@ -24,10 +24,10 @@ int test01() { std::string_view s = "abcd"; - return s.find((const char*)nullptr); // { dg-warning "null arg" } - return s.find((const char*)nullptr, 1); // { dg-warning "null arg" } - return s.find_first_of((const char*)nullptr); // { dg-warning "null arg" } - return s.find_first_of((const char*)nullptr, 1); // { dg-warning "null arg" } - return s.find_first_not_of((const char*)nullptr); // { dg-warning "null arg" } - return s.find_first_not_of((const char*)nullptr, 1); // { dg-warning "null arg" } + return s.find((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + return s.find((const char*)nullptr, 1); // { dg-warning "\\\[-Wnonnull" } + return s.find_first_of((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + return s.find_first_of((const char*)nullptr, 1); // { dg-warning "\\\[-Wnonnull" } + return s.find_first_not_of((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + return s.find_first_not_of((const char*)nullptr, 1); // { dg-warning "\\\[-Wnonnull" } } diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc index 55119b59a8f..91525a54d1a 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc @@ -24,6 +24,6 @@ int test01() { std::string_view s = "abcd"; - return s.rfind((const char*)nullptr); // { dg-warning "null arg" } - return s.rfind((const char*)nullptr, 1); // { dg-warning "null arg" } + return s.rfind((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" } + return s.rfind((const char*)nullptr, 1); // { dg-warning "\\\[-Wnonnull" } } -- 2.30.2