This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64385] odd behaviour of std::is_move_constructible< std::ostringstream >
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Dec 2014 20:56:43 +0000
- Subject: [Bug c++/64385] odd behaviour of std::is_move_constructible< std::ostringstream >
- Auto-submitted: auto-generated
- References: <bug-64385-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64385
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
As a workaround you can simply instantiate the trait before it is used in the
function template.
Here's a reduced version of the test, which breaks when A is defined, but is
fixed by defining B:
#include <type_traits>
#include <ostream>
using trait = std::is_constructible<std::ostream, const std::ostream&>;
#if B
const bool dummy = trait::value;
#endif
#if A
template<bool> struct X { };
struct moveable_class
{
template <typename Source>
moveable_class(Source&& src, X<trait::value>* = 0)
{ }
};
#endif
static_assert( !trait::value, "");