libstdc++ PR/105580
libstdc++-v3/ChangeLog:
* testsuite/24_iterators/istreambuf_iterator/105580.cc: New test.
---
Pushing a test checking for warning as separate commit, as it make it
easier for me to reliably detect if fix works.
Tested the new file with all standard modes. OK for trunk?
.../24_iterators/istreambuf_iterator/105580.cc | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644
libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/105580.cc
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/105580.cc
b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/105580.cc
new file mode 100644
index 00000000000..7c70b8237c3
--- /dev/null
+++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/105580.cc
@@ -0,0 +1,15 @@
+// { dg-compile }
+// { 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 }
+
--
2.53.0