]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc
1 // { dg-options "-Wnonnull -O0 -Wno-unused-result" }
2 // { dg-do compile { target c++20 } }
4 #include <testsuite_string.h>
7 test01(const __gnu_test::string
& s
)
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" }