[libcxx] r349566 - Portability fix: add missing includes and static_casts. Reviewed as https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch.

Marshall Clow mclow.lists at gmail.com
Tue Dec 18 15:19:00 PST 2018


Author: marshall
Date: Tue Dec 18 15:19:00 2018
New Revision: 349566

URL: http://llvm.org/viewvc/llvm-project?rev=349566&view=rev
Log:
Portability fix: add missing includes and static_casts. Reviewed as https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch.

Modified:
    libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/std.manip/setw.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
    libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/to_string.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/to_wstring.pass.cpp
    libcxx/trunk/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
    libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
    libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
    libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp

Modified: libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp Tue Dec 18 15:19:00 2018
@@ -15,10 +15,12 @@
 
 // unordered_map& operator=(const unordered_map& u);
 
+#include <algorithm>
 #include <unordered_map>
 #include <string>
 #include <cassert>
 #include <cfloat>
+#include <cmath>
 #include <cstddef>
 
 #include "test_macros.h"

Modified: libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp Tue Dec 18 15:19:00 2018
@@ -14,6 +14,7 @@
 // REQUIRES: locale.en_US.UTF-8
 
 #include <iomanip>
+#include <istream>
 #include <cassert>
 
 #include "platform_support.h" // locale name macros

Modified: libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp Tue Dec 18 15:19:00 2018
@@ -14,6 +14,7 @@
 // template <class charT> T9 get_time(struct tm* tmb, const charT* fmt);
 
 #include <iomanip>
+#include <istream>
 #include <cassert>
 
 #include "platform_support.h" // locale name macros

Modified: libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp Tue Dec 18 15:19:00 2018
@@ -14,6 +14,7 @@
 // REQUIRES: locale.en_US.UTF-8
 
 #include <iomanip>
+#include <ostream>
 #include <cassert>
 
 #include "platform_support.h" // locale name macros

Modified: libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp Tue Dec 18 15:19:00 2018
@@ -14,6 +14,7 @@
 // template <class charT> T10 put_time(const struct tm* tmb, const charT* fmt);
 
 #include <iomanip>
+#include <ostream>
 #include <cassert>
 
 #include "platform_support.h" // locale name macros

Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp Tue Dec 18 15:19:00 2018
@@ -15,6 +15,7 @@
 // operator>>(int& val);
 
 #include <istream>
+#include <limits>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp Tue Dec 18 15:19:00 2018
@@ -15,6 +15,7 @@
 // operator>>(short& val);
 
 #include <istream>
+#include <limits>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp Tue Dec 18 15:19:00 2018
@@ -12,6 +12,8 @@
 // T1 resetiosflags(ios_base::fmtflags mask);
 
 #include <iomanip>
+#include <istream>
+#include <ostream>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp Tue Dec 18 15:19:00 2018
@@ -12,6 +12,8 @@
 // T3 setbase(int base);
 
 #include <iomanip>
+#include <istream>
+#include <ostream>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp Tue Dec 18 15:19:00 2018
@@ -12,6 +12,7 @@
 // template<charT> T4 setfill(charT c);
 
 #include <iomanip>
+#include <ostream>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp Tue Dec 18 15:19:00 2018
@@ -12,6 +12,8 @@
 // T2 setiosflags (ios_base::fmtflags mask);
 
 #include <iomanip>
+#include <istream>
+#include <ostream>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp Tue Dec 18 15:19:00 2018
@@ -12,6 +12,8 @@
 // T5 setprecision(int n);
 
 #include <iomanip>
+#include <istream>
+#include <ostream>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/input.output/iostream.format/std.manip/setw.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/std.manip/setw.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/std.manip/setw.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/std.manip/setw.pass.cpp Tue Dec 18 15:19:00 2018
@@ -12,6 +12,8 @@
 // T6 setw(int n);
 
 #include <iomanip>
+#include <istream>
+#include <ostream>
 #include <cassert>
 
 template <class CharT>

Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp Tue Dec 18 15:19:00 2018
@@ -20,6 +20,7 @@
 #include <vector>
 #include <cassert>
 #include <cstddef>
+#include <cstring>
 
 typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
 

Modified: libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp Tue Dec 18 15:19:00 2018
@@ -17,6 +17,7 @@
 #include <locale>
 #include <ios>
 #include <cassert>
+#include <limits>
 #include <streambuf>
 #include "test_iterators.h"
 
@@ -46,6 +47,7 @@ int main()
     const my_facet f(1);
     std::ios ios(0);
     long v = -1;
+    const std::ios_base::fmtflags zf = static_cast<std::ios_base::fmtflags>(0);
     {
         const char str[] = "123";
         assert((ios.flags() & ios.basefield) == ios.dec);
@@ -110,7 +112,7 @@ int main()
     }
     {
         const char str[] = "123";
-        ios.setf(0, ios.basefield);
+        ios.setf(zf, ios.basefield);
         std::ios_base::iostate err = ios.goodbit;
         input_iterator<const char*> iter =
             f.get(input_iterator<const char*>(str),
@@ -122,7 +124,7 @@ int main()
     }
     {
         const char str[] = "0x123";
-        ios.setf(0, ios.basefield);
+        ios.setf(zf, ios.basefield);
         std::ios_base::iostate err = ios.goodbit;
         input_iterator<const char*> iter =
             f.get(input_iterator<const char*>(str),
@@ -134,7 +136,7 @@ int main()
     }
     {
         const char str[] = "0123";
-        ios.setf(0, ios.basefield);
+        ios.setf(zf, ios.basefield);
         std::ios_base::iostate err = ios.goodbit;
         input_iterator<const char*> iter =
             f.get(input_iterator<const char*>(str),
@@ -146,7 +148,7 @@ int main()
     }
     {
         const char str[] = "2-";
-        ios.setf(0, ios.basefield);
+        ios.setf(zf, ios.basefield);
         std::ios_base::iostate err = ios.goodbit;
         input_iterator<const char*> iter =
             f.get(input_iterator<const char*>(str),

Modified: libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp Tue Dec 18 15:19:00 2018
@@ -14,6 +14,7 @@
 // iter_type get(iter_type in, iter_type end, ios_base&,
 //               ios_base::iostate& err, unsigned int& v) const;
 
+#include <limits>
 #include <locale>
 #include <ios>
 #include <cassert>

Modified: libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp Tue Dec 18 15:19:00 2018
@@ -10,6 +10,7 @@
 // <cwchar>
 
 #include <cwchar>
+#include <ctime>
 #include <cstdarg>
 #include <type_traits>
 

Modified: libcxx/trunk/test/std/strings/string.conversions/to_string.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/to_string.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/to_string.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/to_string.pass.cpp Tue Dec 18 15:19:00 2018
@@ -19,6 +19,7 @@
 // string to_string(double val);
 // string to_string(long double val);
 
+#include <limits>
 #include <string>
 #include <cassert>
 #include <sstream>

Modified: libcxx/trunk/test/std/strings/string.conversions/to_wstring.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/to_wstring.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/to_wstring.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/to_wstring.pass.cpp Tue Dec 18 15:19:00 2018
@@ -19,6 +19,7 @@
 // wstring to_wstring(double val);
 // wstring to_wstring(long double val);
 
+#include <limits>
 #include <string>
 #include <cassert>
 #include <sstream>

Modified: libcxx/trunk/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp Tue Dec 18 15:19:00 2018
@@ -16,6 +16,7 @@
 //     ...
 // };
 
+#include <limits>
 #include <memory>
 #include <new>
 #include <type_traits>

Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp Tue Dec 18 15:19:00 2018
@@ -15,6 +15,7 @@
 
 // UNSUPPORTED: c++98, c++03
 
+#include <memory>
 #include <tuple>
 #include <utility>
 #include <cassert>

Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp Tue Dec 18 15:19:00 2018
@@ -14,6 +14,7 @@
 
 // See llvm.org/PR20855
 
+#include <functional>
 #include <tuple>
 #include <string>
 #include <cassert>

Modified: libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp?rev=349566&r1=349565&r2=349566&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp Tue Dec 18 15:19:00 2018
@@ -19,6 +19,7 @@
 // };
 
 #include <typeindex>
+#include <type_traits>
 #include <cassert>
 
 int main()




More information about the libcxx-commits mailing list