This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64385] odd behaviour of std::is_move_constructible< std::ostringstream >


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, "");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]