Fix unused private field warning in stdexcept after r207695.
Add a new _LIBCPP_UNUSED define in __config, which can be used to indicate explicitly unused items, and apply it to the __imp__ field of __libcpp_refstring. Somebody who knows about Microsoft C++ and IBM C++ should fill in the unused attribute syntax appropriate for those compilers, if there is any. Differential Revision: http://reviews.llvm.org/D6836 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e64ec52760
commit
70e0af45ae
@ -258,6 +258,8 @@ 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_defaulted_functions))
|
#if !(__has_feature(cxx_defaulted_functions))
|
||||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
#endif // !(__has_feature(cxx_defaulted_functions))
|
#endif // !(__has_feature(cxx_defaulted_functions))
|
||||||
@ -380,6 +382,8 @@ 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)
|
||||||
@ -477,6 +481,7 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
|
|||||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
#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
|
||||||
|
|
||||||
@ -500,6 +505,7 @@ 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 _NOEXCEPT throw()
|
#define _NOEXCEPT throw()
|
||||||
#define _NOEXCEPT_(x)
|
#define _NOEXCEPT_(x)
|
||||||
|
@ -53,7 +53,7 @@ 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_;
|
const char *__imp_ _LIBCPP_UNUSED;
|
||||||
};
|
};
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user