===================================================================
@@ -112,8 +112,13 @@
* This allows you to write constructs such as
* <code>if (!a_stream) ...</code> and <code>while (a_stream) ...</code>
*/
+#if __cplusplus >= 201103L
+ explicit operator bool() const
+ { return !this->fail(); }
+#else
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+#endif
bool
operator!() const
===================================================================
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+// Copyright (C) 2013 Free Software Foundation, Inc.
+
+#include <iostream>
+
+// PR libstdc++/56193
+
+int
+test01()
+{
+ std::cout << std::cout; // { dg-error "cannot bind" }
+}
+
+// { dg-error "initializing argument" "" { target *-*-* } 602 }