noexcept and constexpr applied to <ios>.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2012-07-21 01:03:40 +00:00
parent bd143086ac
commit f57bd564fd
3 changed files with 39 additions and 36 deletions

View File

@@ -29,43 +29,43 @@ public:
class failure; class failure;
typedef T1 fmtflags; typedef T1 fmtflags;
static const fmtflags boolalpha; static constexpr fmtflags boolalpha;
static const fmtflags dec; static constexpr fmtflags dec;
static const fmtflags fixed; static constexpr fmtflags fixed;
static const fmtflags hex; static constexpr fmtflags hex;
static const fmtflags internal; static constexpr fmtflags internal;
static const fmtflags left; static constexpr fmtflags left;
static const fmtflags oct; static constexpr fmtflags oct;
static const fmtflags right; static constexpr fmtflags right;
static const fmtflags scientific; static constexpr fmtflags scientific;
static const fmtflags showbase; static constexpr fmtflags showbase;
static const fmtflags showpoint; static constexpr fmtflags showpoint;
static const fmtflags showpos; static constexpr fmtflags showpos;
static const fmtflags skipws; static constexpr fmtflags skipws;
static const fmtflags unitbuf; static constexpr fmtflags unitbuf;
static const fmtflags uppercase; static constexpr fmtflags uppercase;
static const fmtflags adjustfield; static constexpr fmtflags adjustfield;
static const fmtflags basefield; static constexpr fmtflags basefield;
static const fmtflags floatfield; static constexpr fmtflags floatfield;
typedef T2 iostate; typedef T2 iostate;
static const iostate badbit; static constexpr iostate badbit;
static const iostate eofbit; static constexpr iostate eofbit;
static const iostate failbit; static constexpr iostate failbit;
static const iostate goodbit; static constexpr iostate goodbit;
typedef T3 openmode; typedef T3 openmode;
static const openmode app; static constexpr openmode app;
static const openmode ate; static constexpr openmode ate;
static const openmode binary; static constexpr openmode binary;
static const openmode in; static constexpr openmode in;
static const openmode out; static constexpr openmode out;
static const openmode trunc; static constexpr openmode trunc;
typedef T4 seekdir; typedef T4 seekdir;
static const seekdir beg; static constexpr seekdir beg;
static const seekdir cur; static constexpr seekdir cur;
static const seekdir end; static constexpr seekdir end;
class Init; class Init;
@@ -160,7 +160,7 @@ protected:
basic_ios(); basic_ios();
void init(basic_streambuf<charT,traits>* sb); void init(basic_streambuf<charT,traits>* sb);
void move(basic_ios& rhs); void move(basic_ios& rhs);
void swap(basic_ios& rhs); void swap(basic_ios& rhs) noexcept;
void set_rdbuf(basic_streambuf<charT, traits>* sb); void set_rdbuf(basic_streambuf<charT, traits>* sb);
}; };
@@ -342,7 +342,7 @@ protected:
void __call_callbacks(event); void __call_callbacks(event);
void copyfmt(const ios_base&); void copyfmt(const ios_base&);
void move(ios_base&); void move(ios_base&);
void swap(ios_base&); void swap(ios_base&) _NOEXCEPT;
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
void set_rdbuf(void* __sb) void set_rdbuf(void* __sb)
@@ -632,7 +632,7 @@ protected:
void move(basic_ios&& __rhs) {move(__rhs);} void move(basic_ios&& __rhs) {move(__rhs);}
#endif #endif
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void swap(basic_ios& __rhs); void swap(basic_ios& __rhs) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb); void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
private: private:
@@ -774,7 +774,7 @@ basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
template <class _CharT, class _Traits> template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
void void
basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
{ {
ios_base::swap(__rhs); ios_base::swap(__rhs);
_VSTD::swap(__tie_, __rhs.__tie_); _VSTD::swap(__tie_, __rhs.__tie_);

View File

@@ -401,7 +401,7 @@ ios_base::move(ios_base& rhs)
} }
void void
ios_base::swap(ios_base& rhs) ios_base::swap(ios_base& rhs) _NOEXCEPT
{ {
_VSTD::swap(__fmtflags_, rhs.__fmtflags_); _VSTD::swap(__fmtflags_, rhs.__fmtflags_);
_VSTD::swap(__precision_, rhs.__precision_); _VSTD::swap(__precision_, rhs.__precision_);

View File

@@ -78,6 +78,9 @@
#include <cstdarg> #include <cstdarg>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-zero-length"
int main() int main()
{ {
std::FILE* fp = 0; std::FILE* fp = 0;