Skip to content

Commit 888e2f8

Browse files
committed
Revert "[libc++] Clang-tidy enable modernize-use-nullptr. (llvm#76659)"
This reverts commit 020ea3e. This seems to break `test/libcxx/clang_tidy.gen.py/regex.sh.cpp` (in C++03 mode for some reason): ``` 2024-01-17T07:32:22.1759374Z # RUN: at line 12 2024-01-17T07:32:22.1773919Z clang-tidy-18 /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/test/libcxx/clang_tidy.gen.py/regex.sh.cpp --warnings-as-errors=* -header-filter=.* --config-file=/home/runner/_work/llvm-project/llvm-project/libcxx/.clang-tidy -- -Wweak-vtables -nostdinc++ -I /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1 -I /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1 -I /home/runner/_work/llvm-project/llvm-project/libcxx/test/support -std=c++03 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -fno-modules 2024-01-17T07:32:22.1803227Z # executed command: clang-tidy-18 /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/test/libcxx/clang_tidy.gen.py/regex.sh.cpp '--warnings-as-errors=*' '-header-filter=.*' --config-file=/home/runner/_work/llvm-project/llvm-project/libcxx/.clang-tidy -- -Wweak-vtables -nostdinc++ -I /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1 -I /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1 -I /home/runner/_work/llvm-project/llvm-project/libcxx/test/support -std=c++03 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -fno-modules 2024-01-17T07:32:22.1817757Z # .---command stdout------------ 2024-01-17T07:32:22.1820160Z # | /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__iterator/iterator_traits.h:124:50: error: use nullptr [modernize-use-nullptr,-warnings-as-errors] 2024-01-17T07:32:22.1822498Z # | 124 | static const bool value = decltype(__test<_Tp>(0, 0, 0, 0, 0))::value; 2024-01-17T07:32:22.1823337Z # | | ^ 2024-01-17T07:32:22.1824052Z # | | nullptr 2024-01-17T07:32:22.1826651Z # | /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__iterator/iterator_traits.h:124:53: error: use nullptr [modernize-use-nullptr,-warnings-as-errors] 2024-01-17T07:32:22.1829325Z # | 124 | static const bool value = decltype(__test<_Tp>(0, 0, 0, 0, 0))::value; 2024-01-17T07:32:22.1831137Z # | | ^ 2024-01-17T07:32:22.1831963Z # | | nullptr 2024-01-17T07:32:22.1834149Z # | /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__iterator/iterator_traits.h:124:56: error: use nullptr [modernize-use-nullptr,-warnings-as-errors] 2024-01-17T07:32:22.1848711Z # | 124 | static const bool value = decltype(__test<_Tp>(0, 0, 0, 0, 0))::value; 2024-01-17T07:32:22.1849506Z # | | ^ 2024-01-17T07:32:22.1849997Z # | | nullptr 2024-01-17T07:32:22.1851528Z # | /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__iterator/iterator_traits.h:124:59: error: use nullptr [modernize-use-nullptr,-warnings-as-errors] 2024-01-17T07:32:22.1853391Z # | 124 | static const bool value = decltype(__test<_Tp>(0, 0, 0, 0, 0))::value; 2024-01-17T07:32:22.1854277Z # | | ^ 2024-01-17T07:32:22.1854841Z # | | nullptr 2024-01-17T07:32:22.1856314Z # | /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__iterator/iterator_traits.h:124:62: error: use nullptr [modernize-use-nullptr,-warnings-as-errors] 2024-01-17T07:32:22.1857768Z # | 124 | static const bool value = decltype(__test<_Tp>(0, 0, 0, 0, 0))::value; 2024-01-17T07:32:22.1858493Z # | | ^ 2024-01-17T07:32:22.1858998Z # | | nullptr 2024-01-17T07:32:22.1859503Z # `----------------------------- 2024-01-17T07:32:22.1859900Z # .---command stderr------------ 2024-01-17T07:32:22.1860259Z # | 43 warnings generated. 2024-01-17T07:32:22.1860710Z # | Suppressed 33 warnings (33 in non-user code). 2024-01-17T07:32:22.1861809Z # | Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2024-01-17T07:32:22.1862750Z # | 5 warnings treated as errors 2024-01-17T07:32:22.1863229Z # `----------------------------- 2024-01-17T07:32:22.1863622Z # error: command failed with exit status: 1 ``` (see https://github.com/llvm/llvm-project/actions/runs/7552394884/job/20561192096)
1 parent da0755f commit 888e2f8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

libcxx/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Checks: >
1515
1616
modernize-loop-convert,
1717
modernize-redundant-void-arg,
18-
modernize-use-nullptr,
1918
modernize-use-override,
2019
2120
readability-duplicate-include,
@@ -69,6 +68,7 @@ CheckOptions:
6968
# modernize-use-default-member-init,
7069
# modernize-use-equals-default,
7170
# modernize-use-equals-delete,
71+
# modernize-use-nullptr,
7272
# portability-restrict-system-includes,
7373
# readability-function-cognitive-complexity,
7474
# readability-implicit-bool-conversion,

libcxx/include/__atomic/is_always_lock_free.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2020
template <class _Tp>
2121
struct __libcpp_is_always_lock_free {
2222
// __atomic_always_lock_free is available in all Standard modes
23-
static const bool __value = __atomic_always_lock_free(sizeof(_Tp), nullptr);
23+
static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
2424
};
2525

2626
_LIBCPP_END_NAMESPACE_STD

libcxx/include/locale

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3421,7 +3421,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::~wbuffer_convert() {
34213421
template <class _Codecvt, class _Elem, class _Tr>
34223422
typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow() {
34233423
_LIBCPP_SUPPRESS_DEPRECATED_POP
3424-
if (__cv_ == 0 || __bufptr_ == nullptr)
3424+
if (__cv_ == 0 || __bufptr_ == 0)
34253425
return traits_type::eof();
34263426
bool __initial = __read_mode();
34273427
char_type __1buf;
@@ -3478,7 +3478,7 @@ template <class _Codecvt, class _Elem, class _Tr>
34783478
typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type
34793479
wbuffer_convert<_Codecvt, _Elem, _Tr>::pbackfail(int_type __c) {
34803480
_LIBCPP_SUPPRESS_DEPRECATED_POP
3481-
if (__cv_ != 0 && __bufptr_ && this->eback() < this->gptr()) {
3481+
if (__cv_ != 0 && __bufptr_ != 0 && this->eback() < this->gptr()) {
34823482
if (traits_type::eq_int_type(__c, traits_type::eof())) {
34833483
this->gbump(-1);
34843484
return traits_type::not_eof(__c);
@@ -3496,7 +3496,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
34963496
template <class _Codecvt, class _Elem, class _Tr>
34973497
typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type wbuffer_convert<_Codecvt, _Elem, _Tr>::overflow(int_type __c) {
34983498
_LIBCPP_SUPPRESS_DEPRECATED_POP
3499-
if (__cv_ == 0 || !__bufptr_)
3499+
if (__cv_ == 0 || __bufptr_ == 0)
35003500
return traits_type::eof();
35013501
__write_mode();
35023502
char_type __1buf;
@@ -3588,7 +3588,7 @@ template <class _Codecvt, class _Elem, class _Tr>
35883588
typename wbuffer_convert<_Codecvt, _Elem, _Tr>::pos_type
35893589
wbuffer_convert<_Codecvt, _Elem, _Tr>::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __om) {
35903590
int __width = __cv_->encoding();
3591-
if (__cv_ == 0 || !__bufptr_ || (__width <= 0 && __off != 0) || sync())
3591+
if (__cv_ == 0 || __bufptr_ == 0 || (__width <= 0 && __off != 0) || sync())
35923592
return pos_type(off_type(-1));
35933593
// __width > 0 || __off == 0, now check __way
35943594
if (__way != ios_base::beg && __way != ios_base::cur && __way != ios_base::end)
@@ -3601,7 +3601,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::seekoff(off_type __off, ios_base::seekdir
36013601
template <class _Codecvt, class _Elem, class _Tr>
36023602
typename wbuffer_convert<_Codecvt, _Elem, _Tr>::pos_type
36033603
wbuffer_convert<_Codecvt, _Elem, _Tr>::seekpos(pos_type __sp, ios_base::openmode __wch) {
3604-
if (__cv_ == 0 || !__bufptr_ || sync())
3604+
if (__cv_ == 0 || __bufptr_ == 0 || sync())
36053605
return pos_type(off_type(-1));
36063606
if (__bufptr_->pubseekpos(__sp, __wch) == pos_type(off_type(-1)))
36073607
return pos_type(off_type(-1));
@@ -3611,7 +3611,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::seekpos(pos_type __sp, ios_base::openmode
36113611
template <class _Codecvt, class _Elem, class _Tr>
36123612
int wbuffer_convert<_Codecvt, _Elem, _Tr>::sync() {
36133613
_LIBCPP_SUPPRESS_DEPRECATED_POP
3614-
if (__cv_ == 0 || !__bufptr_)
3614+
if (__cv_ == 0 || __bufptr_ == 0)
36153615
return 0;
36163616
if (__cm_ & ios_base::out) {
36173617
if (this->pptr() != this->pbase())

0 commit comments

Comments
 (0)