Skip to content

Commit 507c18b

Browse files
committed
[clang-tidy] Few tiny fixes after #99084
Update documentation, and correct configuration
1 parent c5432d3 commit 507c18b

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
138138
"^::sigismember$;"
139139
"^::strcasecmp$;"
140140
"^::strsignal$;"
141-
"^::ttyname"))),
141+
"^::ttyname$"))),
142142
CheckedReturnTypes(utils::options::parseStringList(
143-
Options.get("CheckedReturnTypes", "::std::error_code$;"
144-
"::std::error_condition$;"
145-
"::std::errc$;"
146-
"::std::expected$;"
147-
"::boost::system::error_code"))),
143+
Options.get("CheckedReturnTypes", "^::std::error_code$;"
144+
"^::std::error_condition$;"
145+
"^::std::errc$;"
146+
"^::std::expected$;"
147+
"^::boost::system::error_code$"))),
148148
AllowCastToVoid(Options.get("AllowCastToVoid", false)) {}
149149

150150
UnusedReturnValueCheck::UnusedReturnValueCheck(

clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,26 @@ Options
1616
This parameter supports regexp. The function is checked if the name
1717
and scope matches, with any arguments.
1818
By default the following functions are checked:
19-
``::std::async$, ::std::launder$, ::std::remove$, ::std::remove_if$, ::std::unique$,
20-
::std::unique_ptr::release$, ::std::basic_string::empty$, ::std::vector::empty$,
21-
::std::back_inserter$, ::std::distance$, ::std::find$, ::std::find_if$, ::std::inserter$,
22-
::std::lower_bound$, ::std::make_pair$, ::std::map::count$, ::std::map::find$,
23-
::std::map::lower_bound$, ::std::multimap::equal_range$, ::std::multimap::upper_bound$,
24-
::std::set::count$, ::std::set::find$, ::std::setfill$, ::std::setprecision$,
25-
::std::setw$, ::std::upper_bound$, ::std::vector::at$, ::bsearch$, ::ferror$,
26-
::feof$, ::isalnum$, ::isalpha$, ::isblank$, ::iscntrl$, ::isdigit$, ::isgraph$,
27-
::islower$, ::isprint$, ::ispunct$, ::isspace$, ::isupper$, ::iswalnum$, ::iswprint$,
28-
::iswspace$, ::isxdigit$, ::memchr$, ::memcmp$, ::strcmp$, ::strcoll$, ::strncmp$,
29-
::strpbrk$, ::strrchr$, ::strspn$, ::strstr$, ::wcscmp$, ::access$, ::bind$,
30-
::connect$, ::difftime$, ::dlsym$, ::fnmatch$, ::getaddrinfo$, ::getopt$,
31-
::htonl$, ::htons$, ::iconv_open$, ::inet_addr$, isascii$, isatty$, ::mmap$,
32-
::newlocale$, ::openat$, ::pathconf$, ::pthread_equal$, ::pthread_getspecific$,
33-
::pthread_mutex_trylock$, ::readdir$, ::readlink$, ::recvmsg$, ::regexec$, ::scandir$,
34-
::semget$, ::setjmp$, ::shm_open$, ::shmget$, ::sigismember$, ::strcasecmp$, ::strsignal$,
35-
::ttyname$``
19+
``^::std::async$, ^::std::launder$, ^::std::remove$, ^::std::remove_if$,
20+
^::std::unique$, ^::std::unique_ptr::release$, ^::std::basic_string::empty$,
21+
^::std::vector::empty$, ^::std::back_inserter$, ^::std::distance$,
22+
^::std::find$, ^::std::find_if$, ^::std::inserter$, ^::std::lower_bound$,
23+
^::std::make_pair$, ^::std::map::count$, ^::std::map::find$,
24+
^::std::map::lower_bound$, ^::std::multimap::equal_range$,
25+
^::std::multimap::upper_bound$, ^::std::set::count$, ^::std::set::find$,
26+
^::std::setfill$, ^::std::setprecision$, ^::std::setw$, ^::std::upper_bound$,
27+
^::std::vector::at$, ^::bsearch$, ^::ferror$, ^::feof$, ^::isalnum$,
28+
^::isalpha$, ^::isblank$, ^::iscntrl$, ^::isdigit$, ^::isgraph$, ^::islower$,
29+
^::isprint$, ^::ispunct$, ^::isspace$, ^::isupper$, ^::iswalnum$,
30+
^::iswprint$, ^::iswspace$, ^::isxdigit$, ^::memchr$, ^::memcmp$, ^::strcmp$,
31+
^::strcoll$, ^::strncmp$, ^::strpbrk$, ^::strrchr$, ^::strspn$, ^::strstr$,
32+
^::wcscmp$, ^::access$, ^::bind$, ^::connect$, ^::difftime$, ^::dlsym$,
33+
^::fnmatch$, ^::getaddrinfo$, ^::getopt$, ^::htonl$, ^::htons$,
34+
^::iconv_open$, ^::inet_addr$, isascii$, isatty$, ^::mmap$, ^::newlocale$,
35+
^::openat$, ^::pathconf$, ^::pthread_equal$, ^::pthread_getspecific$,
36+
^::pthread_mutex_trylock$, ^::readdir$, ^::readlink$, ^::recvmsg$,
37+
^::regexec$, ^::scandir$, ^::semget$, ^::setjmp$, ^::shm_open$, ^::shmget$,
38+
^::sigismember$, ^::strcasecmp$, ^::strsignal$, ^::ttyname$``
3639

3740
- ``std::async()``. Not using the return value makes the call synchronous.
3841
- ``std::launder()``. Not using the return value usually means that the
@@ -54,7 +57,8 @@ Options
5457

5558
Semicolon-separated list of function return types to check.
5659
By default the following function return types are checked:
57-
`::std::error_code`, `::std::error_condition`, `::std::errc`, `::std::expected`, `::boost::system::error_code`
60+
`^::std::error_code$`, `^::std::error_condition$`, `^::std::errc$`,
61+
`^::std::expected$`, `^::boost::system::error_code$`
5862

5963
.. option:: AllowCastToVoid
6064

0 commit comments

Comments
 (0)