Fix most GCC attribute ignored warnings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267074 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -319,8 +319,6 @@ typedef __char32_t char32_t;
|
|||||||
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
|
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _LIBCPP_UNUSED __attribute__((__unused__))
|
|
||||||
|
|
||||||
#if !(__has_feature(cxx_default_function_template_args))
|
#if !(__has_feature(cxx_default_function_template_args))
|
||||||
#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
|
#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
|
||||||
#endif
|
#endif
|
||||||
@@ -459,8 +457,6 @@ namespace std {
|
|||||||
|
|
||||||
#define _LIBCPP_NORETURN __attribute__((noreturn))
|
#define _LIBCPP_NORETURN __attribute__((noreturn))
|
||||||
|
|
||||||
#define _LIBCPP_UNUSED __attribute__((__unused__))
|
|
||||||
|
|
||||||
#if _GNUC_VER >= 407
|
#if _GNUC_VER >= 407
|
||||||
#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
|
#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
|
||||||
#define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
|
#define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
|
||||||
@@ -566,7 +562,6 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
|
|||||||
#define _LIBCPP_HAS_NO_NOEXCEPT
|
#define _LIBCPP_HAS_NO_NOEXCEPT
|
||||||
#define __alignof__ __alignof
|
#define __alignof__ __alignof
|
||||||
#define _LIBCPP_NORETURN __declspec(noreturn)
|
#define _LIBCPP_NORETURN __declspec(noreturn)
|
||||||
#define _LIBCPP_UNUSED
|
|
||||||
#define _ALIGNAS(x) __declspec(align(x))
|
#define _ALIGNAS(x) __declspec(align(x))
|
||||||
#define _LIBCPP_HAS_NO_VARIADICS
|
#define _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
@@ -588,7 +583,6 @@ namespace std {
|
|||||||
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
|
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
|
||||||
#define _ATTRIBUTE(x) __attribute__((x))
|
#define _ATTRIBUTE(x) __attribute__((x))
|
||||||
#define _LIBCPP_NORETURN __attribute__((noreturn))
|
#define _LIBCPP_NORETURN __attribute__((noreturn))
|
||||||
#define _LIBCPP_UNUSED
|
|
||||||
|
|
||||||
#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
|
#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
|
||||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ struct _LIBCPP_TYPE_VIS_ONLY binary_function
|
|||||||
typedef _Result result_type;
|
typedef _Result result_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash;
|
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct __has_result_type
|
struct __has_result_type
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -656,7 +656,7 @@ __bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <size_t _Size> class _LIBCPP_TYPE_VIS_ONLY bitset;
|
template <size_t _Size> class _LIBCPP_TYPE_VIS_ONLY bitset;
|
||||||
template <size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY hash<bitset<_Size> >;
|
template <size_t _Size> struct hash<bitset<_Size> >;
|
||||||
|
|
||||||
template <size_t _Size>
|
template <size_t _Size>
|
||||||
class _LIBCPP_TYPE_VIS_ONLY bitset
|
class _LIBCPP_TYPE_VIS_ONLY bitset
|
||||||
|
|||||||
@@ -3166,8 +3166,6 @@ template<class _Tp, class... _Args>
|
|||||||
|
|
||||||
#endif // _LIBCPP_STD_VER > 11
|
#endif // _LIBCPP_STD_VER > 11
|
||||||
|
|
||||||
template <class _Tp> struct hash;
|
|
||||||
|
|
||||||
template <class _Size>
|
template <class _Size>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
_Size
|
_Size
|
||||||
@@ -3978,23 +3976,23 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
operator=(shared_ptr<_Yp>&& __r);
|
operator=(shared_ptr<_Yp>&& __r);
|
||||||
template<class _Yp>
|
template<class _Yp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
!is_array<_Yp>::value &&
|
!is_array<_Yp>::value &&
|
||||||
is_convertible<_Yp*, element_type*>::value,
|
is_convertible<_Yp*, element_type*>::value,
|
||||||
shared_ptr
|
shared_ptr
|
||||||
>::type&
|
>::type&
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
operator=(auto_ptr<_Yp>&& __r);
|
operator=(auto_ptr<_Yp>&& __r);
|
||||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
template<class _Yp>
|
template<class _Yp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
!is_array<_Yp>::value &&
|
!is_array<_Yp>::value &&
|
||||||
is_convertible<_Yp*, element_type*>::value,
|
is_convertible<_Yp*, element_type*>::value,
|
||||||
shared_ptr&
|
shared_ptr&
|
||||||
>::type
|
>::type
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
operator=(auto_ptr<_Yp> __r);
|
operator=(auto_ptr<_Yp> __r);
|
||||||
#endif
|
#endif
|
||||||
template <class _Yp, class _Dp>
|
template <class _Yp, class _Dp>
|
||||||
@@ -5622,7 +5620,7 @@ _LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t&
|
|||||||
|
|
||||||
// --- Helper for container swap --
|
// --- Helper for container swap --
|
||||||
template <typename _Alloc>
|
template <typename _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
|
void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
|
||||||
#if _LIBCPP_STD_VER >= 14
|
#if _LIBCPP_STD_VER >= 14
|
||||||
_NOEXCEPT
|
_NOEXCEPT
|
||||||
@@ -5648,7 +5646,7 @@ void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename _Alloc>
|
template <typename _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
|
void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
|
||||||
|
|
||||||
template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
|
template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
|
||||||
|
|||||||
@@ -53,7 +53,11 @@ public:
|
|||||||
#ifndef _LIBCPP___REFSTRING
|
#ifndef _LIBCPP___REFSTRING
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
class _LIBCPP_HIDDEN __libcpp_refstring {
|
class _LIBCPP_HIDDEN __libcpp_refstring {
|
||||||
const char *__imp_ _LIBCPP_UNUSED;
|
#ifdef __clang__
|
||||||
|
const char *__imp_ __attribute__((__unused__)); // only clang emits a warning
|
||||||
|
#else
|
||||||
|
const char *__imp_;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -961,7 +961,7 @@ char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a)
|
|||||||
|
|
||||||
// __str_find
|
// __str_find
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find(const _CharT *__p, _SizeT __sz,
|
__str_find(const _CharT *__p, _SizeT __sz,
|
||||||
_CharT __c, _SizeT __pos) _NOEXCEPT
|
_CharT __c, _SizeT __pos) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -974,7 +974,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find(const _CharT *__p, _SizeT __sz,
|
__str_find(const _CharT *__p, _SizeT __sz,
|
||||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -995,7 +995,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
|
|||||||
// __str_rfind
|
// __str_rfind
|
||||||
|
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_rfind(const _CharT *__p, _SizeT __sz,
|
__str_rfind(const _CharT *__p, _SizeT __sz,
|
||||||
_CharT __c, _SizeT __pos) _NOEXCEPT
|
_CharT __c, _SizeT __pos) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1014,7 +1014,7 @@ __str_rfind(const _CharT *__p, _SizeT __sz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_rfind(const _CharT *__p, _SizeT __sz,
|
__str_rfind(const _CharT *__p, _SizeT __sz,
|
||||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1033,7 +1033,7 @@ __str_rfind(const _CharT *__p, _SizeT __sz,
|
|||||||
|
|
||||||
// __str_find_first_of
|
// __str_find_first_of
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find_first_of(const _CharT *__p, _SizeT __sz,
|
__str_find_first_of(const _CharT *__p, _SizeT __sz,
|
||||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1049,7 +1049,7 @@ __str_find_first_of(const _CharT *__p, _SizeT __sz,
|
|||||||
|
|
||||||
// __str_find_last_of
|
// __str_find_last_of
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find_last_of(const _CharT *__p, _SizeT __sz,
|
__str_find_last_of(const _CharT *__p, _SizeT __sz,
|
||||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1072,7 +1072,7 @@ __str_find_last_of(const _CharT *__p, _SizeT __sz,
|
|||||||
|
|
||||||
// __str_find_first_not_of
|
// __str_find_first_not_of
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
|
__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
|
||||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1088,7 +1088,7 @@ __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
|
|||||||
|
|
||||||
|
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
|
__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
|
||||||
_CharT __c, _SizeT __pos) _NOEXCEPT
|
_CharT __c, _SizeT __pos) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1105,7 +1105,7 @@ __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
|
|||||||
|
|
||||||
// __str_find_last_not_of
|
// __str_find_last_not_of
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
|
__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
|
||||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -1121,7 +1121,7 @@ __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
|
|||||||
|
|
||||||
|
|
||||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||||
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||||
__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
|
__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
|
||||||
_CharT __c, _SizeT __pos) _NOEXCEPT
|
_CharT __c, _SizeT __pos) _NOEXCEPT
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ _LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
|
|||||||
|
|
||||||
} // this_thread
|
} // this_thread
|
||||||
|
|
||||||
template<> struct _LIBCPP_TYPE_VIS_ONLY hash<__thread_id>;
|
template<> struct hash<__thread_id>;
|
||||||
|
|
||||||
class _LIBCPP_TYPE_VIS_ONLY __thread_id
|
class _LIBCPP_TYPE_VIS_ONLY __thread_id
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -382,6 +382,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY pair;
|
template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY pair;
|
||||||
template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY reference_wrapper;
|
template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY reference_wrapper;
|
||||||
|
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash;
|
||||||
|
|
||||||
template <class>
|
template <class>
|
||||||
struct __void_t { typedef void type; };
|
struct __void_t { typedef void type; };
|
||||||
|
|||||||
@@ -2825,10 +2825,10 @@ ucs4_to_utf16le(const uint32_t* frm, const uint32_t* frm_end, const uint32_t*& f
|
|||||||
to_nxt = to;
|
to_nxt = to;
|
||||||
if (mode & generate_header)
|
if (mode & generate_header)
|
||||||
{
|
{
|
||||||
if (to_end-to_nxt < 2)
|
if (to_end - to_nxt < 2)
|
||||||
return codecvt_base::partial;
|
return codecvt_base::partial;
|
||||||
*to_nxt++ = static_cast<uint8_t>(0xFF);
|
*to_nxt++ = static_cast<uint8_t>(0xFF);
|
||||||
*to_nxt++ = static_cast<uint8_t>(0xFE);
|
*to_nxt++ = static_cast<uint8_t>(0xFE);
|
||||||
}
|
}
|
||||||
for (; frm_nxt < frm_end; ++frm_nxt)
|
for (; frm_nxt < frm_end; ++frm_nxt)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user