[libcxx-commits] [libcxx] 4262b52 - [libc++][NFC] Enable modernize-use-override
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 25 11:55:18 PDT 2022
Author: Nikolas Klauser
Date: 2022-08-25T20:55:08+02:00
New Revision: 4262b523ff16928ff6edfb303081bf470b99cac2
URL: https://github.com/llvm/llvm-project/commit/4262b523ff16928ff6edfb303081bf470b99cac2
DIFF: https://github.com/llvm/llvm-project/commit/4262b523ff16928ff6edfb303081bf470b99cac2.diff
LOG: [libc++][NFC] Enable modernize-use-override
Reviewed By: Mordante, #libc
Spies: aheejin, libcxx-commits, smeenai
Differential Revision: https://reviews.llvm.org/D124714
Added:
Modified:
libcxx/.clang-tidy
libcxx/include/__debug
libcxx/include/__format/format_error.h
libcxx/include/__functional/function.h
libcxx/include/__locale
libcxx/include/__memory/shared_ptr.h
libcxx/include/any
libcxx/include/codecvt
libcxx/include/exception
libcxx/include/experimental/memory_resource
libcxx/include/fstream
libcxx/include/future
libcxx/include/ios
libcxx/include/istream
libcxx/include/locale
libcxx/include/new
libcxx/include/optional
libcxx/include/ostream
libcxx/include/regex
libcxx/include/sstream
libcxx/include/stdexcept
libcxx/include/strstream
libcxx/include/system_error
libcxx/include/typeinfo
libcxx/include/variant
libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
Removed:
################################################################################
diff --git a/libcxx/.clang-tidy b/libcxx/.clang-tidy
index d4fc0b8c5e337..c8798af378ca9 100644
--- a/libcxx/.clang-tidy
+++ b/libcxx/.clang-tidy
@@ -15,6 +15,7 @@ Checks: >
modernize-loop-convert,
modernize-redundant-void-arg,
+ modernize-use-override,
readability-duplicate-include,
readability-identifier-naming,
@@ -49,7 +50,6 @@ CheckOptions:
# modernize-use-equals-default,
# modernize-use-equals-delete,
# modernize-use-nullptr,
-# modernize-use-override,
# portability-restrict-system-includes,
# readability-function-cognitive-complexity,
# readability-implicit-bool-conversion,
diff --git a/libcxx/include/__debug b/libcxx/include/__debug
index 80f8dcbccafbf..742384b1515cf 100644
--- a/libcxx/include/__debug
+++ b/libcxx/include/__debug
@@ -87,10 +87,10 @@ struct _C_node
explicit _C_node(void* __c, __c_node* __n)
: __c_node(__c, __n) {}
- virtual bool __dereferenceable(const void*) const;
- virtual bool __decrementable(const void*) const;
- virtual bool __addable(const void*, ptr
diff _t) const;
- virtual bool __subscriptable(const void*, ptr
diff _t) const;
+ bool __dereferenceable(const void*) const override;
+ bool __decrementable(const void*) const override;
+ bool __addable(const void*, ptr
diff _t) const override;
+ bool __subscriptable(const void*, ptr
diff _t) const override;
};
template <class _Cont>
diff --git a/libcxx/include/__format/format_error.h b/libcxx/include/__format/format_error.h
index 67ff41cbc3d83..2ca527279e0b8 100644
--- a/libcxx/include/__format/format_error.h
+++ b/libcxx/include/__format/format_error.h
@@ -31,7 +31,7 @@ class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
: runtime_error(__s) {}
_LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s)
: runtime_error(__s) {}
- virtual ~format_error() noexcept;
+ ~format_error() noexcept override;
};
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index db3af6e24101b..bcecd3e5623d0 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -45,13 +45,13 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call
// bad_function_call will end up containing a weak definition of the vtable and
// typeinfo.
#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
- virtual ~bad_function_call() _NOEXCEPT;
+ ~bad_function_call() _NOEXCEPT override;
#else
- virtual ~bad_function_call() _NOEXCEPT {}
+ ~bad_function_call() _NOEXCEPT override {}
#endif
#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
- virtual const char* what() const _NOEXCEPT;
+ const char* what() const _NOEXCEPT override;
#endif
};
_LIBCPP_DIAGNOSTIC_POP
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 40f9a3ff57c22..1588a223001fa 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -191,12 +191,12 @@ protected:
explicit facet(size_t __refs = 0)
: __shared_count(static_cast<long>(__refs)-1) {}
- virtual ~facet();
+ ~facet() override;
// facet(const facet&) = delete; // effectively done in __shared_count
// void operator=(const facet&) = delete;
private:
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
};
class _LIBCPP_TYPE_VIS locale::id
@@ -291,7 +291,7 @@ public:
static locale::id id;
protected:
- ~collate();
+ ~collate() override;
virtual int do_compare(const char_type* __lo1, const char_type* __hi1,
const char_type* __lo2, const char_type* __hi2) const;
virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const
@@ -359,10 +359,10 @@ public:
explicit collate_byname(const string& __n, size_t __refs = 0);
protected:
- ~collate_byname();
- virtual int do_compare(const char_type* __lo1, const char_type* __hi1,
- const char_type* __lo2, const char_type* __hi2) const;
- virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const;
+ ~collate_byname() override;
+ int do_compare(const char_type* __lo1, const char_type* __hi1,
+ const char_type* __lo2, const char_type* __hi2) const override;
+ string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -379,11 +379,11 @@ public:
explicit collate_byname(const string& __n, size_t __refs = 0);
protected:
- ~collate_byname();
+ ~collate_byname() override;
- virtual int do_compare(const char_type* __lo1, const char_type* __hi1,
- const char_type* __lo2, const char_type* __hi2) const;
- virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const;
+ int do_compare(const char_type* __lo1, const char_type* __hi1,
+ const char_type* __lo2, const char_type* __hi2) const override;
+ string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
};
#endif
@@ -643,7 +643,7 @@ public:
static locale::id id;
protected:
- ~ctype();
+ ~ctype() override;
virtual bool do_is(mask __m, char_type __c) const;
virtual const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const;
virtual const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const;
@@ -773,7 +773,7 @@ public:
#endif
protected:
- ~ctype();
+ ~ctype() override;
virtual char_type do_toupper(char_type __c) const;
virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const;
virtual char_type do_tolower(char_type __c) const;
@@ -799,11 +799,11 @@ public:
explicit ctype_byname(const string&, size_t = 0);
protected:
- ~ctype_byname();
- virtual char_type do_toupper(char_type) const;
- virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const;
- virtual char_type do_tolower(char_type) const;
- virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
+ ~ctype_byname() override;
+ char_type do_toupper(char_type) const override;
+ const char_type* do_toupper(char_type* __low, const char_type* __high) const override;
+ char_type do_tolower(char_type) const override;
+ const char_type* do_tolower(char_type* __low, const char_type* __high) const override;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -818,19 +818,19 @@ public:
explicit ctype_byname(const string&, size_t = 0);
protected:
- ~ctype_byname();
- virtual bool do_is(mask __m, char_type __c) const;
- virtual const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const;
- virtual const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const;
- virtual const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const;
- virtual char_type do_toupper(char_type) const;
- virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const;
- virtual char_type do_tolower(char_type) const;
- virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
- virtual char_type do_widen(char) const;
- virtual const char* do_widen(const char* __low, const char* __high, char_type* __dest) const;
- virtual char do_narrow(char_type, char __dfault) const;
- virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
+ ~ctype_byname() override;
+ bool do_is(mask __m, char_type __c) const override;
+ const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const override;
+ const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const override;
+ const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const override;
+ char_type do_toupper(char_type) const override;
+ const char_type* do_toupper(char_type* __low, const char_type* __high) const override;
+ char_type do_tolower(char_type) const override;
+ const char_type* do_tolower(char_type* __low, const char_type* __high) const override;
+ char_type do_widen(char) const override;
+ const char* do_widen(const char* __low, const char* __high, char_type* __dest) const override;
+ char do_narrow(char_type, char __dfault) const override;
+ const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const override;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -1021,7 +1021,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1105,7 +1105,7 @@ public:
protected:
explicit codecvt(const char*, size_t __refs = 0);
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1192,7 +1192,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1280,7 +1280,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1368,7 +1368,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1456,7 +1456,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1488,7 +1488,7 @@ public:
explicit codecvt_byname(const string& __nm, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
protected:
- ~codecvt_byname();
+ ~codecvt_byname() override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -1540,7 +1540,7 @@ struct _LIBCPP_TYPE_VIS __narrow_to_utf8<16>
__narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__narrow_to_utf8();
+ ~__narrow_to_utf8() override;
template <class _OutputIterator, class _CharT>
_LIBCPP_INLINE_VISIBILITY
@@ -1576,7 +1576,7 @@ struct _LIBCPP_TYPE_VIS __narrow_to_utf8<32>
__narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__narrow_to_utf8();
+ ~__narrow_to_utf8() override;
template <class _OutputIterator, class _CharT>
_LIBCPP_INLINE_VISIBILITY
@@ -1634,7 +1634,7 @@ struct _LIBCPP_TYPE_VIS __widen_from_utf8<16>
__widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__widen_from_utf8();
+ ~__widen_from_utf8() override;
template <class _OutputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -1670,7 +1670,7 @@ struct _LIBCPP_TYPE_VIS __widen_from_utf8<32>
__widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__widen_from_utf8();
+ ~__widen_from_utf8() override;
template <class _OutputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -1720,7 +1720,7 @@ public:
static locale::id id;
protected:
- ~numpunct();
+ ~numpunct() override;
virtual char_type do_decimal_point() const;
virtual char_type do_thousands_sep() const;
virtual string do_grouping() const;
@@ -1752,7 +1752,7 @@ public:
static locale::id id;
protected:
- ~numpunct();
+ ~numpunct() override;
virtual char_type do_decimal_point() const;
virtual char_type do_thousands_sep() const;
virtual string do_grouping() const;
@@ -1781,7 +1781,7 @@ public:
explicit numpunct_byname(const string& __nm, size_t __refs = 0);
protected:
- ~numpunct_byname();
+ ~numpunct_byname() override;
private:
void __init(const char*);
@@ -1800,7 +1800,7 @@ public:
explicit numpunct_byname(const string& __nm, size_t __refs = 0);
protected:
- ~numpunct_byname();
+ ~numpunct_byname() override;
private:
void __init(const char*);
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index 609dec709c8cb..9239f9c629c9b 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -130,8 +130,8 @@ class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
public:
bad_weak_ptr() _NOEXCEPT = default;
bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
- virtual ~bad_weak_ptr() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_weak_ptr() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
@@ -196,7 +196,7 @@ class _LIBCPP_TYPE_VIS __shared_weak_count
: __shared_count(__refs),
__shared_weak_owners_(__refs) {}
protected:
- virtual ~__shared_weak_count();
+ ~__shared_weak_count() override;
public:
#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
@@ -239,12 +239,12 @@ class __shared_ptr_pointer
: __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
#ifndef _LIBCPP_NO_RTTI
- virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
+ const void* __get_deleter(const type_info&) const _NOEXCEPT override;
#endif
private:
- virtual void __on_zero_shared() _NOEXCEPT;
- virtual void __on_zero_shared_weak() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
+ void __on_zero_shared_weak() _NOEXCEPT override;
};
#ifndef _LIBCPP_NO_RTTI
@@ -304,7 +304,7 @@ struct __shared_ptr_emplace
_Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
private:
- virtual void __on_zero_shared() _NOEXCEPT {
+ void __on_zero_shared() _NOEXCEPT override {
#if _LIBCPP_STD_VER > 17
using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
_TpAlloc __tmp(*__get_alloc());
@@ -314,7 +314,7 @@ struct __shared_ptr_emplace
#endif
}
- virtual void __on_zero_shared_weak() _NOEXCEPT {
+ void __on_zero_shared_weak() _NOEXCEPT override {
using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type;
using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer;
_ControlBlockAlloc __tmp(*__get_alloc());
diff --git a/libcxx/include/any b/libcxx/include/any
index 66f7488e54417..b256630b05785 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -106,7 +106,7 @@ namespace std {
class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
{
public:
- virtual const char* what() const _NOEXCEPT;
+ const char* what() const _NOEXCEPT override;
};
} // namespace std
diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt
index 9f18a7b1a9893..cbe5511b6f089 100644
--- a/libcxx/include/codecvt
+++ b/libcxx/include/codecvt
@@ -98,22 +98,18 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
_Mode_(__mode) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -137,22 +133,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -175,22 +167,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -235,22 +223,19 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
_Mode_(__mode) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
+ size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
template <>
@@ -274,22 +259,18 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
_Mode_(__mode) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -313,22 +294,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -351,22 +328,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -389,22 +362,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -427,22 +396,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -487,22 +452,18 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
_Mode_(__mode) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -526,22 +487,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -564,22 +521,18 @@ public:
_LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
- virtual result
- do_out(state_type& __st,
- const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual result
- do_in(state_type& __st,
- const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
- intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
- virtual result
- do_unshift(state_type& __st,
- extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
- virtual int do_encoding() const _NOEXCEPT;
- virtual bool do_always_noconv() const _NOEXCEPT;
- virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
- size_t __mx) const;
- virtual int do_max_length() const _NOEXCEPT;
+ result do_out(state_type& __st,
+ const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ result do_in(state_type& __st,
+ const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
+ intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const override;
+ result do_unshift(state_type& __st,
+ extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
+ int do_encoding() const _NOEXCEPT override;
+ bool do_always_noconv() const _NOEXCEPT override;
+ int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
+ int do_max_length() const _NOEXCEPT override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
diff --git a/libcxx/include/exception b/libcxx/include/exception
index 6b164e1dbd119..04057c3cbe3b4 100644
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -156,8 +156,8 @@ public:
class _LIBCPP_EXCEPTION_ABI bad_exception : public exception {
public:
_LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
- virtual ~bad_exception() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_exception() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
#endif // !_LIBCPP_ABI_VCRUNTIME
diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource
index f7b19aafd40f5..42ed63501d9db 100644
--- a/libcxx/include/experimental/memory_resource
+++ b/libcxx/include/experimental/memory_resource
@@ -379,7 +379,7 @@ public:
// 8.7.3, memory.resource.adaptor.mem
private:
- virtual void * do_allocate(size_t __bytes, size_t)
+ void * do_allocate(size_t __bytes, size_t) override
{
if (__bytes > __max_size())
__throw_bad_array_new_length();
@@ -387,7 +387,7 @@ private:
return __alloc_.allocate(__s);
}
- virtual void do_deallocate(void * __p, size_t __bytes, size_t)
+ void do_deallocate(void * __p, size_t __bytes, size_t) override
{
_LIBCPP_ASSERT(__bytes <= __max_size(),
"do_deallocate called for size which exceeds the maximum allocation size");
@@ -395,7 +395,7 @@ private:
__alloc_.deallocate((_ValueType*)__p, __s);
}
- virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT {
+ bool do_is_equal(memory_resource const & __other) const _NOEXCEPT override {
__resource_adaptor_imp const * __p
= dynamic_cast<__resource_adaptor_imp const *>(&__other);
return __p ? __alloc_ == __p->__alloc_ : false;
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index ffa75b14eb15f..a6bd4a83b680e 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -226,7 +226,7 @@ public:
// 27.9.1.2 Constructors/destructor:
basic_filebuf();
basic_filebuf(basic_filebuf&& __rhs);
- virtual ~basic_filebuf();
+ ~basic_filebuf() override;
// 27.9.1.3 Assign/swap:
_LIBCPP_INLINE_VISIBILITY
@@ -259,16 +259,16 @@ public:
protected:
// 27.9.1.5 Overridden virtual functions:
- virtual int_type underflow();
- virtual int_type pbackfail(int_type __c = traits_type::eof());
- virtual int_type overflow (int_type __c = traits_type::eof());
- virtual basic_streambuf<char_type, traits_type>* setbuf(char_type* __s, streamsize __n);
- virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
- ios_base::openmode __wch = ios_base::in | ios_base::out);
- virtual pos_type seekpos(pos_type __sp,
- ios_base::openmode __wch = ios_base::in | ios_base::out);
- virtual int sync();
- virtual void imbue(const locale& __loc);
+ int_type underflow() override;
+ int_type pbackfail(int_type __c = traits_type::eof()) override;
+ int_type overflow (int_type __c = traits_type::eof()) override;
+ basic_streambuf<char_type, traits_type>* setbuf(char_type* __s, streamsize __n) override;
+ pos_type seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __wch = ios_base::in | ios_base::out) override;
+ pos_type seekpos(pos_type __sp,
+ ios_base::openmode __wch = ios_base::in | ios_base::out) override;
+ int sync() override;
+ void imbue(const locale& __loc) override;
private:
char* __extbuf_;
diff --git a/libcxx/include/future b/libcxx/include/future
index 111fb64e8f0a9..5c29b28f57f9f 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -518,7 +518,7 @@ public:
const error_code& code() const _NOEXCEPT {return __ec_;}
future_error(const future_error&) _NOEXCEPT = default;
- virtual ~future_error() _NOEXCEPT;
+ ~future_error() _NOEXCEPT override;
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
@@ -544,7 +544,7 @@ protected:
mutable condition_variable __cv_;
unsigned __state_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
void __sub_wait(unique_lock<mutex>& __lk);
public:
enum
@@ -631,7 +631,7 @@ class _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_HIDDEN __assoc_state
protected:
_Up __value_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
public:
template <class _Arg>
@@ -711,7 +711,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
protected:
_Up __value_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
public:
void set_value(_Rp& __arg);
@@ -823,7 +823,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
typedef __assoc_sub_state base;
_Alloc __alloc_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __assoc_sub_state_alloc(const _Alloc& __a)
@@ -895,7 +895,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
- virtual void __execute();
+ void __execute() override;
};
template <class _Fp>
@@ -982,12 +982,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
_Fp __func_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
- virtual void __execute();
+ void __execute() override;
};
template <class _Fp>
diff --git a/libcxx/include/ios b/libcxx/include/ios
index 0015e573f0d27..2f9efcc3c772e 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -441,7 +441,7 @@ public:
explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
failure(const failure&) _NOEXCEPT = default;
- virtual ~failure() _NOEXCEPT;
+ ~failure() _NOEXCEPT override;
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
@@ -641,7 +641,7 @@ public:
// 27.5.4.1 Constructor/destructor:
_LIBCPP_INLINE_VISIBILITY
explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
- virtual ~basic_ios();
+ ~basic_ios() override;
// 27.5.4.2 Members:
_LIBCPP_INLINE_VISIBILITY
diff --git a/libcxx/include/istream b/libcxx/include/istream
index 82776e3a10156..403b29c29e9e3 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -192,7 +192,7 @@ public:
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb) : __gc_(0)
{ this->init(__sb); }
- virtual ~basic_istream();
+ ~basic_istream() override;
protected:
inline _LIBCPP_INLINE_VISIBILITY
basic_istream(basic_istream&& __rhs);
@@ -1408,7 +1408,7 @@ public:
: basic_istream<_CharT, _Traits>(__sb)
{}
- virtual ~basic_iostream();
+ ~basic_iostream() override;
protected:
inline _LIBCPP_INLINE_VISIBILITY
basic_iostream(basic_iostream&& __rhs);
diff --git a/libcxx/include/locale b/libcxx/include/locale
index b01c66d0430f6..ff12f665156ce 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -681,8 +681,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~num_get() {}
+ _LIBCPP_HIDE_FROM_ABI ~num_get() override {}
template <class _Fp>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
@@ -1352,8 +1351,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~num_put() {}
+ _LIBCPP_HIDE_FROM_ABI ~num_put() override {}
virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl,
bool __v) const;
@@ -1798,8 +1796,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~time_get() {}
+ _LIBCPP_HIDE_FROM_ABI ~time_get() override {}
virtual dateorder do_date_order() const;
virtual iter_type do_get_time(iter_type __b, iter_type __e, ios_base& __iob,
@@ -2416,26 +2413,25 @@ public:
__time_get_storage<_CharT>(__nm) {}
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~time_get_byname() {}
+ _LIBCPP_HIDE_FROM_ABI ~time_get_byname() override {}
_LIBCPP_INLINE_VISIBILITY
- virtual dateorder do_date_order() const {return this->__do_date_order();}
+ dateorder do_date_order() const override {return this->__do_date_order();}
private:
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type* __weeks() const {return this->__weeks_;}
+ const string_type* __weeks() const override {return this->__weeks_;}
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type* __months() const {return this->__months_;}
+ const string_type* __months() const override {return this->__months_;}
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type* __am_pm() const {return this->__am_pm_;}
+ const string_type* __am_pm() const override {return this->__am_pm_;}
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type& __c() const {return this->__c_;}
+ const string_type& __c() const override {return this->__c_;}
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type& __r() const {return this->__r_;}
+ const string_type& __r() const override {return this->__r_;}
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type& __x() const {return this->__x_;}
+ const string_type& __x() const override {return this->__x_;}
_LIBCPP_INLINE_VISIBILITY
- virtual const string_type& __X() const {return this->__X_;}
+ const string_type& __X() const override {return this->__X_;}
};
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>;
@@ -2483,8 +2479,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~time_put() {}
+ _LIBCPP_HIDE_FROM_ABI ~time_put() override {}
virtual iter_type do_put(iter_type __s, ios_base&, char_type, const tm* __tm,
char __fmt, char __mod) const;
@@ -2572,8 +2567,7 @@ public:
: time_put<_CharT, _OutputIterator>(__nm, __refs) {}
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~time_put_byname() {}
+ _LIBCPP_HIDE_FROM_ABI ~time_put_byname() override {}
};
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>;
@@ -2621,8 +2615,7 @@ public:
static const bool intl = _International;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~moneypunct() {}
+ _LIBCPP_HIDE_FROM_ABI ~moneypunct() override {}
virtual char_type do_decimal_point() const {return numeric_limits<char_type>::max();}
virtual char_type do_thousands_sep() const {return numeric_limits<char_type>::max();}
@@ -2672,18 +2665,17 @@ public:
: moneypunct<_CharT, _International>(__refs) {init(__nm.c_str());}
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~moneypunct_byname() {}
-
- virtual char_type do_decimal_point() const {return __decimal_point_;}
- virtual char_type do_thousands_sep() const {return __thousands_sep_;}
- virtual string do_grouping() const {return __grouping_;}
- virtual string_type do_curr_symbol() const {return __curr_symbol_;}
- virtual string_type do_positive_sign() const {return __positive_sign_;}
- virtual string_type do_negative_sign() const {return __negative_sign_;}
- virtual int do_frac_digits() const {return __frac_digits_;}
- virtual pattern do_pos_format() const {return __pos_format_;}
- virtual pattern do_neg_format() const {return __neg_format_;}
+ _LIBCPP_HIDE_FROM_ABI ~moneypunct_byname() override {}
+
+ char_type do_decimal_point() const override {return __decimal_point_;}
+ char_type do_thousands_sep() const override {return __thousands_sep_;}
+ string do_grouping() const override {return __grouping_;}
+ string_type do_curr_symbol() const override {return __curr_symbol_;}
+ string_type do_positive_sign() const override {return __positive_sign_;}
+ string_type do_negative_sign() const override {return __negative_sign_;}
+ int do_frac_digits() const override {return __frac_digits_;}
+ pattern do_pos_format() const override {return __pos_format_;}
+ pattern do_neg_format() const override {return __neg_format_;}
private:
char_type __decimal_point_;
@@ -2801,9 +2793,7 @@ public:
static locale::id id;
protected:
-
- _LIBCPP_INLINE_VISIBILITY
- ~money_get() {}
+ _LIBCPP_HIDE_FROM_ABI ~money_get() override {}
virtual iter_type do_get(iter_type __b, iter_type __e, bool __intl,
ios_base& __iob, ios_base::iostate& __err,
@@ -3347,8 +3337,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~money_put() {}
+ _LIBCPP_HIDE_FROM_ABI ~money_put() override {}
virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __iob,
char_type __fl, long double __units) const;
@@ -3516,8 +3505,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~messages() {}
+ _LIBCPP_HIDE_FROM_ABI ~messages() override {}
virtual catalog do_open(const basic_string<char>&, const locale&) const;
virtual string_type do_get(catalog, int __set, int __msgid,
@@ -3606,8 +3594,7 @@ public:
: messages<_CharT>(__refs) {}
protected:
- _LIBCPP_INLINE_VISIBILITY
- ~messages_byname() {}
+ _LIBCPP_HIDE_FROM_ABI ~messages_byname() override {}
};
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;
diff --git a/libcxx/include/new b/libcxx/include/new
index 90959d54f9764..29c1d9e835011 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -129,8 +129,8 @@ class _LIBCPP_EXCEPTION_ABI bad_alloc
{
public:
bad_alloc() _NOEXCEPT;
- virtual ~bad_alloc() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_alloc() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
class _LIBCPP_EXCEPTION_ABI bad_array_new_length
@@ -138,8 +138,8 @@ class _LIBCPP_EXCEPTION_ABI bad_array_new_length
{
public:
bad_array_new_length() _NOEXCEPT;
- virtual ~bad_array_new_length() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_array_new_length() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
typedef void (*new_handler)();
diff --git a/libcxx/include/optional b/libcxx/include/optional
index d5c97e6fa91e0..865a71781708a 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -207,8 +207,8 @@ class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optiona
{
public:
// Get the key function ~bad_optional_access() into the dylib
- virtual ~bad_optional_access() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_optional_access() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
} // namespace std
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index 2ef0034ca6623..59f7de673df6a 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -197,7 +197,7 @@ public:
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
{ this->init(__sb); }
- virtual ~basic_ostream();
+ ~basic_ostream() override;
protected:
inline _LIBCPP_INLINE_VISIBILITY
basic_ostream(basic_ostream&& __rhs);
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 689d25ecf49d8..a3bbc3c03686f 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -1006,8 +1006,8 @@ class _LIBCPP_EXCEPTION_ABI regex_error
public:
explicit regex_error(regex_constants::error_type __ecode);
regex_error(const regex_error&) _NOEXCEPT = default;
- virtual ~regex_error() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ ~regex_error() _NOEXCEPT override;
+ _LIBCPP_INLINE_VISIBILITY
regex_constants::error_type code() const {return __code_;}
};
@@ -1507,7 +1507,7 @@ public:
explicit __owns_one_state(__node<_CharT>* __s)
: base(__s) {}
- virtual ~__owns_one_state();
+ ~__owns_one_state() override;
};
template <class _CharT>
@@ -2196,7 +2196,7 @@ public:
__match_any_but_newline(__node<_CharT>* __s)
: base(__s) {}
- virtual void __exec(__state&) const;
+ void __exec(__state&) const override;
};
template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<char>::__exec(__state&) const;
diff --git a/libcxx/include/sstream b/libcxx/include/sstream
index 602a1b55b4a97..3bd5663517590 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -250,14 +250,14 @@ public:
protected:
// 27.8.1.4 Overridden virtual functions:
- virtual int_type underflow();
- virtual int_type pbackfail(int_type __c = traits_type::eof());
- virtual int_type overflow (int_type __c = traits_type::eof());
- virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
- ios_base::openmode __wch = ios_base::in | ios_base::out);
+ int_type underflow() override;
+ int_type pbackfail(int_type __c = traits_type::eof()) override;
+ int_type overflow (int_type __c = traits_type::eof()) override;
+ pos_type seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __wch = ios_base::in | ios_base::out) override;
_LIBCPP_INLINE_VISIBILITY
- virtual pos_type seekpos(pos_type __sp,
- ios_base::openmode __wch = ios_base::in | ios_base::out) {
+ pos_type seekpos(pos_type __sp,
+ ios_base::openmode __wch = ios_base::in | ios_base::out) override {
return seekoff(__sp, ios_base::beg, __wch);
}
};
diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index ee5a296cd9305..68de6ced174a7 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -87,9 +87,9 @@ public:
logic_error(const logic_error&) _NOEXCEPT;
logic_error& operator=(const logic_error&) _NOEXCEPT;
- virtual ~logic_error() _NOEXCEPT;
+ ~logic_error() _NOEXCEPT override;
- virtual const char* what() const _NOEXCEPT;
+ const char* what() const _NOEXCEPT override;
#else
public:
explicit logic_error(const _VSTD::string&); // Symbol uses versioned std::string
@@ -110,9 +110,9 @@ public:
runtime_error(const runtime_error&) _NOEXCEPT;
runtime_error& operator=(const runtime_error&) _NOEXCEPT;
- virtual ~runtime_error() _NOEXCEPT;
+ ~runtime_error() _NOEXCEPT override;
- virtual const char* what() const _NOEXCEPT;
+ const char* what() const _NOEXCEPT override;
#else
public:
explicit runtime_error(const _VSTD::string&); // Symbol uses versioned std::string
@@ -129,7 +129,7 @@ public:
#ifndef _LIBCPP_ABI_VCRUNTIME
domain_error(const domain_error&) _NOEXCEPT = default;
- virtual ~domain_error() _NOEXCEPT;
+ ~domain_error() _NOEXCEPT override;
#endif
};
@@ -142,7 +142,7 @@ public:
#ifndef _LIBCPP_ABI_VCRUNTIME
invalid_argument(const invalid_argument&) _NOEXCEPT = default;
- virtual ~invalid_argument() _NOEXCEPT;
+ ~invalid_argument() _NOEXCEPT override;
#endif
};
@@ -154,7 +154,7 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
length_error(const length_error&) _NOEXCEPT = default;
- virtual ~length_error() _NOEXCEPT;
+ ~length_error() _NOEXCEPT override;
#endif
};
@@ -167,7 +167,7 @@ public:
#ifndef _LIBCPP_ABI_VCRUNTIME
out_of_range(const out_of_range&) _NOEXCEPT = default;
- virtual ~out_of_range() _NOEXCEPT;
+ ~out_of_range() _NOEXCEPT override;
#endif
};
@@ -180,7 +180,7 @@ public:
#ifndef _LIBCPP_ABI_VCRUNTIME
range_error(const range_error&) _NOEXCEPT = default;
- virtual ~range_error() _NOEXCEPT;
+ ~range_error() _NOEXCEPT override;
#endif
};
@@ -193,7 +193,7 @@ public:
#ifndef _LIBCPP_ABI_VCRUNTIME
overflow_error(const overflow_error&) _NOEXCEPT = default;
- virtual ~overflow_error() _NOEXCEPT;
+ ~overflow_error() _NOEXCEPT override;
#endif
};
@@ -206,7 +206,7 @@ public:
#ifndef _LIBCPP_ABI_VCRUNTIME
underflow_error(const underflow_error&) _NOEXCEPT = default;
- virtual ~underflow_error() _NOEXCEPT;
+ ~underflow_error() _NOEXCEPT override;
#endif
};
diff --git a/libcxx/include/strstream b/libcxx/include/strstream
index 72386bb9567f3..9382473f68f5f 100644
--- a/libcxx/include/strstream
+++ b/libcxx/include/strstream
@@ -167,7 +167,7 @@ public:
strstreambuf& operator=(strstreambuf&& __rhs);
#endif // _LIBCPP_CXX03_LANG
- virtual ~strstreambuf();
+ ~strstreambuf() override;
void swap(strstreambuf& __rhs);
@@ -176,13 +176,13 @@ public:
int pcount() const;
protected:
- virtual int_type overflow (int_type __c = EOF);
- virtual int_type pbackfail(int_type __c = EOF);
- virtual int_type underflow();
- virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
- ios_base::openmode __which = ios_base::in | ios_base::out);
- virtual pos_type seekpos(pos_type __sp,
- ios_base::openmode __which = ios_base::in | ios_base::out);
+ int_type overflow (int_type __c = EOF) override;
+ int_type pbackfail(int_type __c = EOF) override;
+ int_type underflow() override;
+ pos_type seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __which = ios_base::in | ios_base::out) override;
+ pos_type seekpos(pos_type __sp,
+ ios_base::openmode __which = ios_base::in | ios_base::out) override;
private:
typedef unsigned __mode_type;
@@ -272,7 +272,7 @@ public:
}
#endif // _LIBCPP_CXX03_LANG
- virtual ~istrstream();
+ ~istrstream() override;
_LIBCPP_INLINE_VISIBILITY
void swap(istrstream& __rhs)
@@ -321,7 +321,7 @@ public:
}
#endif // _LIBCPP_CXX03_LANG
- virtual ~ostrstream();
+ ~ostrstream() override;
_LIBCPP_INLINE_VISIBILITY
void swap(ostrstream& __rhs)
@@ -381,7 +381,7 @@ public:
}
#endif // _LIBCPP_CXX03_LANG
- virtual ~strstream();
+ ~strstream() override;
_LIBCPP_INLINE_VISIBILITY
void swap(strstream& __rhs)
diff --git a/libcxx/include/system_error b/libcxx/include/system_error
index 1da4d7352252d..ce6785aef0368 100644
--- a/libcxx/include/system_error
+++ b/libcxx/include/system_error
@@ -248,7 +248,7 @@ class _LIBCPP_HIDDEN __do_message
: public error_category
{
public:
- virtual string message(int __ev) const;
+ string message(int __ev) const override;
};
_LIBCPP_FUNC_VIS const error_category& generic_category() _NOEXCEPT;
@@ -508,7 +508,7 @@ public:
system_error(int __ev, const error_category& __ecat, const char* __what_arg);
system_error(int __ev, const error_category& __ecat);
system_error(const system_error&) _NOEXCEPT = default;
- ~system_error() _NOEXCEPT;
+ ~system_error() _NOEXCEPT override;
_LIBCPP_INLINE_VISIBILITY
const error_code& code() const _NOEXCEPT {return __ec_;}
diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index 8cf45f7527c04..6d2663d8e717a 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -353,8 +353,8 @@ class _LIBCPP_EXCEPTION_ABI bad_cast
public:
bad_cast() _NOEXCEPT;
bad_cast(const bad_cast&) _NOEXCEPT = default;
- virtual ~bad_cast() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_cast() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
class _LIBCPP_EXCEPTION_ABI bad_typeid
@@ -362,8 +362,8 @@ class _LIBCPP_EXCEPTION_ABI bad_typeid
{
public:
bad_typeid() _NOEXCEPT;
- virtual ~bad_typeid() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
+ ~bad_typeid() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
};
} // namespace std
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 69ff0e5b6ed97..e6988f3c1710e 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -247,7 +247,7 @@ namespace std { // explicitly not using versioning namespace
class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS bad_variant_access : public exception {
public:
- virtual const char* what() const _NOEXCEPT;
+ const char* what() const _NOEXCEPT override;
};
} // namespace std
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
index 3e35de2a7cacd..a7378275970f9 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
@@ -17,8 +17,17 @@
int main(int, char**)
{
- std::basic_filebuf<char, std::char_traits<wchar_t> > f;
+ std::basic_filebuf<char, std::char_traits<wchar_t> > f;
// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
return 0;
}
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
index 884fdc4dca26d..545530bef1c68 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
@@ -21,6 +21,18 @@ int main(int, char**)
// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at istream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at istream:* {{only virtual member functions can be marked 'override'}}
+
// FIXME: As of commit r324062 Clang incorrectly generates a diagnostic about mismatching
// exception specifications for types which are already invalid for one reason or another.
// For now we tolerate this diagnostic.
diff --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
index 009ed31cf9e80..273dd0fe4c857 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
@@ -26,6 +26,7 @@ struct test_istream
int main(int, char**)
{
// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error at istream:* {{only virtual member functions can be marked 'override'}}
return 0;
}
diff --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
index 9dba983f748e2..9afcde0d8c68c 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
@@ -26,6 +26,7 @@ struct test_ostream
int main(int, char**)
{
// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error at ostream:* {{only virtual member functions can be marked 'override'}}
return 0;
}
diff --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
index cba2535594c50..23ab5f0c88a0b 100644
--- a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
@@ -24,5 +24,11 @@ int main(int, char**)
// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
// expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+ // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+ // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+
return 0;
}
More information about the libcxx-commits
mailing list