[libcxx-commits] [libcxx] b98b6d9 - [libc++] Eliminate macro _LIBCPP_UNUSED_VAR. NFCI.
Arthur O'Dwyer via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 22 09:02:36 PDT 2021
Author: Arthur O'Dwyer
Date: 2021-04-22T12:02:22-04:00
New Revision: b98b6d99c5e13db7ea4914d8d4be43e6f244a114
URL: https://github.com/llvm/llvm-project/commit/b98b6d99c5e13db7ea4914d8d4be43e6f244a114
DIFF: https://github.com/llvm/llvm-project/commit/b98b6d99c5e13db7ea4914d8d4be43e6f244a114.diff
LOG: [libc++] Eliminate macro _LIBCPP_UNUSED_VAR. NFCI.
Reviewed as part of https://reviews.llvm.org/D100737
Added:
Modified:
libcxx/include/__config
libcxx/include/locale
Removed:
################################################################################
diff --git a/libcxx/include/__config b/libcxx/include/__config
index f69df5137839..0f54cfd88b6d 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1421,8 +1421,6 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
#endif // _LIBCPP_NO_AUTO_LINK
-#define _LIBCPP_UNUSED_VAR(x) ((void)(x))
-
// Configures the fopen close-on-exec mode character, if any. This string will
// be appended to any mode string used by fstream for fopen/fdopen.
//
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 2a8eed609d92..664c470f26c9 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -3572,7 +3572,7 @@ messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
__cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1));
return __cat;
#else // !_LIBCPP_HAS_CATOPEN
- _LIBCPP_UNUSED_VAR(__nm);
+ (void)__nm;
return -1;
#endif // _LIBCPP_HAS_CATOPEN
}
@@ -3596,9 +3596,9 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
__n, __n + _VSTD::strlen(__n));
return __w;
#else // !_LIBCPP_HAS_CATOPEN
- _LIBCPP_UNUSED_VAR(__c);
- _LIBCPP_UNUSED_VAR(__set);
- _LIBCPP_UNUSED_VAR(__msgid);
+ (void)__c;
+ (void)__set;
+ (void)__msgid;
return __dflt;
#endif // _LIBCPP_HAS_CATOPEN
}
@@ -3613,7 +3613,7 @@ messages<_CharT>::do_close(catalog __c) const
nl_catd __cat = (nl_catd)__c;
catclose(__cat);
#else // !_LIBCPP_HAS_CATOPEN
- _LIBCPP_UNUSED_VAR(__c);
+ (void)__c;
#endif // _LIBCPP_HAS_CATOPEN
}
More information about the libcxx-commits
mailing list