mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
libstdc++: Add test for -Wnull-deference in istream_iterator [PR105580]
PR libstdc++/105580 libstdc++-v3/ChangeLog: * testsuite/24_iterators/istreambuf_iterator/105580.cc: New test.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// { dg-compile }
|
||||
// { dg-require-normal-mode "" }
|
||||
// { dg-additional-options "-Wnull-dereference" }
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::istringstream in("Hello, world");
|
||||
std::istreambuf_iterator<char> it(in), end;
|
||||
std::string ss(it, end);
|
||||
return 0;
|
||||
}
|
||||
// { dg-warning ".*null pointer dereference" "" { target *-*-* } 0 }
|
||||
|
||||
Reference in New Issue
Block a user