summaryrefslogtreecommitdiffstats
path: root/libcxx/include/ios
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/ios')
-rw-r--r--libcxx/include/ios12
1 files changed, 10 insertions, 2 deletions
diff --git a/libcxx/include/ios b/libcxx/include/ios
index 4b1306fc2ad8..00c1d5c2d4bc 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -359,7 +359,13 @@ public:
}
protected:
- _LIBCPP_HIDE_FROM_ABI ios_base() { // purposefully does no initialization
+ _LIBCPP_HIDE_FROM_ABI ios_base() : __loc_(nullptr) {
+ // Purposefully does no initialization
+ //
+ // Except for the locale, this is a sentinel to avoid destroying
+ // an uninitialized object. See
+ // test/libcxx/input.output/iostreams.base/ios.base/ios.base.cons/dtor.uninitialized.pass.cpp
+ // for the details.
}
void init(void* __sb);
@@ -571,7 +577,9 @@ public:
_LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const;
protected:
- _LIBCPP_HIDE_FROM_ABI basic_ios() { // purposefully does no initialization
+ _LIBCPP_HIDE_FROM_ABI basic_ios() {
+ // purposefully does no initialization
+ // since the destructor does nothing this does not have ios_base issues.
}
_LIBCPP_HIDE_FROM_ABI void init(basic_streambuf<char_type, traits_type>* __sb);