Portability fix: add missing includes and static_casts. Reviewed as https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349566 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,10 +15,12 @@
|
|||||||
|
|
||||||
// unordered_map& operator=(const unordered_map& u);
|
// unordered_map& operator=(const unordered_map& u);
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
#include <cmath>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// REQUIRES: locale.en_US.UTF-8
|
// REQUIRES: locale.en_US.UTF-8
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "platform_support.h" // locale name macros
|
#include "platform_support.h" // locale name macros
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// template <class charT> T9 get_time(struct tm* tmb, const charT* fmt);
|
// template <class charT> T9 get_time(struct tm* tmb, const charT* fmt);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "platform_support.h" // locale name macros
|
#include "platform_support.h" // locale name macros
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// REQUIRES: locale.en_US.UTF-8
|
// REQUIRES: locale.en_US.UTF-8
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "platform_support.h" // locale name macros
|
#include "platform_support.h" // locale name macros
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// template <class charT> T10 put_time(const struct tm* tmb, const charT* fmt);
|
// template <class charT> T10 put_time(const struct tm* tmb, const charT* fmt);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "platform_support.h" // locale name macros
|
#include "platform_support.h" // locale name macros
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
// operator>>(int& val);
|
// operator>>(int& val);
|
||||||
|
|
||||||
#include <istream>
|
#include <istream>
|
||||||
|
#include <limits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
// operator>>(short& val);
|
// operator>>(short& val);
|
||||||
|
|
||||||
#include <istream>
|
#include <istream>
|
||||||
|
#include <limits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
// T1 resetiosflags(ios_base::fmtflags mask);
|
// T1 resetiosflags(ios_base::fmtflags mask);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
// T3 setbase(int base);
|
// T3 setbase(int base);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
// template<charT> T4 setfill(charT c);
|
// template<charT> T4 setfill(charT c);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
// T2 setiosflags (ios_base::fmtflags mask);
|
// T2 setiosflags (ios_base::fmtflags mask);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
// T5 setprecision(int n);
|
// T5 setprecision(int n);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
// T6 setw(int n);
|
// T6 setw(int n);
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <istream>
|
||||||
|
#include <ostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
|
typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include <locale>
|
#include <locale>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <limits>
|
||||||
#include <streambuf>
|
#include <streambuf>
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ int main()
|
|||||||
const my_facet f(1);
|
const my_facet f(1);
|
||||||
std::ios ios(0);
|
std::ios ios(0);
|
||||||
long v = -1;
|
long v = -1;
|
||||||
|
const std::ios_base::fmtflags zf = static_cast<std::ios_base::fmtflags>(0);
|
||||||
{
|
{
|
||||||
const char str[] = "123";
|
const char str[] = "123";
|
||||||
assert((ios.flags() & ios.basefield) == ios.dec);
|
assert((ios.flags() & ios.basefield) == ios.dec);
|
||||||
@@ -110,7 +112,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const char str[] = "123";
|
const char str[] = "123";
|
||||||
ios.setf(0, ios.basefield);
|
ios.setf(zf, ios.basefield);
|
||||||
std::ios_base::iostate err = ios.goodbit;
|
std::ios_base::iostate err = ios.goodbit;
|
||||||
input_iterator<const char*> iter =
|
input_iterator<const char*> iter =
|
||||||
f.get(input_iterator<const char*>(str),
|
f.get(input_iterator<const char*>(str),
|
||||||
@@ -122,7 +124,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const char str[] = "0x123";
|
const char str[] = "0x123";
|
||||||
ios.setf(0, ios.basefield);
|
ios.setf(zf, ios.basefield);
|
||||||
std::ios_base::iostate err = ios.goodbit;
|
std::ios_base::iostate err = ios.goodbit;
|
||||||
input_iterator<const char*> iter =
|
input_iterator<const char*> iter =
|
||||||
f.get(input_iterator<const char*>(str),
|
f.get(input_iterator<const char*>(str),
|
||||||
@@ -134,7 +136,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const char str[] = "0123";
|
const char str[] = "0123";
|
||||||
ios.setf(0, ios.basefield);
|
ios.setf(zf, ios.basefield);
|
||||||
std::ios_base::iostate err = ios.goodbit;
|
std::ios_base::iostate err = ios.goodbit;
|
||||||
input_iterator<const char*> iter =
|
input_iterator<const char*> iter =
|
||||||
f.get(input_iterator<const char*>(str),
|
f.get(input_iterator<const char*>(str),
|
||||||
@@ -146,7 +148,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const char str[] = "2-";
|
const char str[] = "2-";
|
||||||
ios.setf(0, ios.basefield);
|
ios.setf(zf, ios.basefield);
|
||||||
std::ios_base::iostate err = ios.goodbit;
|
std::ios_base::iostate err = ios.goodbit;
|
||||||
input_iterator<const char*> iter =
|
input_iterator<const char*> iter =
|
||||||
f.get(input_iterator<const char*>(str),
|
f.get(input_iterator<const char*>(str),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// iter_type get(iter_type in, iter_type end, ios_base&,
|
// iter_type get(iter_type in, iter_type end, ios_base&,
|
||||||
// ios_base::iostate& err, unsigned int& v) const;
|
// ios_base::iostate& err, unsigned int& v) const;
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
// <cwchar>
|
// <cwchar>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
#include <ctime>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
// string to_string(double val);
|
// string to_string(double val);
|
||||||
// string to_string(long double val);
|
// string to_string(long double val);
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
// wstring to_wstring(double val);
|
// wstring to_wstring(double val);
|
||||||
// wstring to_wstring(long double val);
|
// wstring to_wstring(long double val);
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
// ...
|
// ...
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
// See llvm.org/PR20855
|
// See llvm.org/PR20855
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
#include <typeindex>
|
#include <typeindex>
|
||||||
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|||||||
Reference in New Issue
Block a user