Add static_asserts to basic_ios and basic_stream_buf to ensure that that the traits match the character type. This is a requirement on the user - now we get consistent failures at compile time instead of incomprehensible error messages or runtime failures. This is also LWG#2994 - not yet adopted.

llvm-svn: 323945
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 1a6493b4e08c7789138b8087a44bcec53b9cd3fa
diff --git a/include/ios b/include/ios
index 61d00b9..0bffa57 100644
--- a/include/ios
+++ b/include/ios
@@ -592,6 +592,9 @@
     typedef typename traits_type::pos_type pos_type;
     typedef typename traits_type::off_type off_type;
 
+    static_assert((is_same<_CharT, typename traits_type::char_type>::value),
+                  "traits_type::char_type must be the same type as CharT");
+
   // __true_value will generate undefined references when linking unless
   // we give it internal linkage.