From 2735097a5595bdf06d9ac97275dfae82af3eb93d Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 8 May 2014 19:30:14 +0100 Subject: re PR libstdc++/13860 (Poor error messages on invalid template parameters for basic_filebuf) PR libstdc++/13860 * include/std/fstream (basic_filebuf): Enforce requirements on traits. From-SVN: r210231 --- libstdc++-v3/include/std/fstream | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libstdc++-v3/include/std/fstream') diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream index 17ccac6..51db21b 100644 --- a/libstdc++-v3/include/std/fstream +++ b/libstdc++-v3/include/std/fstream @@ -71,6 +71,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template class basic_filebuf : public basic_streambuf<_CharT, _Traits> { +#if __cplusplus >= 201103L + template + using __chk_state = __and_, + is_copy_constructible<_Tp>, + is_default_constructible<_Tp>>; + + static_assert(__chk_state::value, + "state_type must be CopyAssignable, CopyConstructible" + " and DefaultConstructible"); + + static_assert(is_same>::value, + "pos_type must be fpos"); +#endif public: // Types: typedef _CharT char_type; -- cgit v1.1