Debian Codegraph @

libstdc++-v3/testsuite/21_strings/basic_string_view/operations/ends_with/nonnull.cc

raw
1 // { dg-options "-Wnonnull -O0 -Wno-unused-result" }
2 // { dg-do compile { target c++20 } }
3
4 #include <string_view>
5
6 void
7 test01(std::string_view s)
8 {
9 s.ends_with((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" }
10 s.ends_with((char*)nullptr); // { dg-warning "\\\[-Wnonnull" }
11 s.ends_with(nullptr); // { dg-warning "\\\[-Wnonnull" }
12 }