Author: Piotr Zegar Date: 2024-07-18T18:19:37Z New Revision: 507c18b445ef88d985d95181db8107f669aed998
URL: https://github.com/llvm/llvm-project/commit/507c18b445ef88d985d95181db8107f669aed998 DIFF: https://github.com/llvm/llvm-project/commit/507c18b445ef88d985d95181db8107f669aed998.diff LOG: [clang-tidy] Few tiny fixes after #99084 Update documentation, and correct configuration Added: Modified: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst Removed: ################################################################################ diff --git a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp index 955a9b94dfaf6..1da5b222c2e8f 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp @@ -138,13 +138,13 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, "^::sigismember$;" "^::strcasecmp$;" "^::strsignal$;" - "^::ttyname"))), + "^::ttyname$"))), CheckedReturnTypes(utils::options::parseStringList( - Options.get("CheckedReturnTypes", "::std::error_code$;" - "::std::error_condition$;" - "::std::errc$;" - "::std::expected$;" - "::boost::system::error_code"))), + Options.get("CheckedReturnTypes", "^::std::error_code$;" + "^::std::error_condition$;" + "^::std::errc$;" + "^::std::expected$;" + "^::boost::system::error_code$"))), AllowCastToVoid(Options.get("AllowCastToVoid", false)) {} UnusedReturnValueCheck::UnusedReturnValueCheck( diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst index 9205ba98729c4..10ae0fe3243a0 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst @@ -16,23 +16,26 @@ Options This parameter supports regexp. The function is checked if the name and scope matches, with any arguments. By default the following functions are checked: - ``::std::async$, ::std::launder$, ::std::remove$, ::std::remove_if$, ::std::unique$, - ::std::unique_ptr::release$, ::std::basic_string::empty$, ::std::vector::empty$, - ::std::back_inserter$, ::std::distance$, ::std::find$, ::std::find_if$, ::std::inserter$, - ::std::lower_bound$, ::std::make_pair$, ::std::map::count$, ::std::map::find$, - ::std::map::lower_bound$, ::std::multimap::equal_range$, ::std::multimap::upper_bound$, - ::std::set::count$, ::std::set::find$, ::std::setfill$, ::std::setprecision$, - ::std::setw$, ::std::upper_bound$, ::std::vector::at$, ::bsearch$, ::ferror$, - ::feof$, ::isalnum$, ::isalpha$, ::isblank$, ::iscntrl$, ::isdigit$, ::isgraph$, - ::islower$, ::isprint$, ::ispunct$, ::isspace$, ::isupper$, ::iswalnum$, ::iswprint$, - ::iswspace$, ::isxdigit$, ::memchr$, ::memcmp$, ::strcmp$, ::strcoll$, ::strncmp$, - ::strpbrk$, ::strrchr$, ::strspn$, ::strstr$, ::wcscmp$, ::access$, ::bind$, - ::connect$, :: diff time$, ::dlsym$, ::fnmatch$, ::getaddrinfo$, ::getopt$, - ::htonl$, ::htons$, ::iconv_open$, ::inet_addr$, isascii$, isatty$, ::mmap$, - ::newlocale$, ::openat$, ::pathconf$, ::pthread_equal$, ::pthread_getspecific$, - ::pthread_mutex_trylock$, ::readdir$, ::readlink$, ::recvmsg$, ::regexec$, ::scandir$, - ::semget$, ::setjmp$, ::shm_open$, ::shmget$, ::sigismember$, ::strcasecmp$, ::strsignal$, - ::ttyname$`` + ``^::std::async$, ^::std::launder$, ^::std::remove$, ^::std::remove_if$, + ^::std::unique$, ^::std::unique_ptr::release$, ^::std::basic_string::empty$, + ^::std::vector::empty$, ^::std::back_inserter$, ^::std::distance$, + ^::std::find$, ^::std::find_if$, ^::std::inserter$, ^::std::lower_bound$, + ^::std::make_pair$, ^::std::map::count$, ^::std::map::find$, + ^::std::map::lower_bound$, ^::std::multimap::equal_range$, + ^::std::multimap::upper_bound$, ^::std::set::count$, ^::std::set::find$, + ^::std::setfill$, ^::std::setprecision$, ^::std::setw$, ^::std::upper_bound$, + ^::std::vector::at$, ^::bsearch$, ^::ferror$, ^::feof$, ^::isalnum$, + ^::isalpha$, ^::isblank$, ^::iscntrl$, ^::isdigit$, ^::isgraph$, ^::islower$, + ^::isprint$, ^::ispunct$, ^::isspace$, ^::isupper$, ^::iswalnum$, + ^::iswprint$, ^::iswspace$, ^::isxdigit$, ^::memchr$, ^::memcmp$, ^::strcmp$, + ^::strcoll$, ^::strncmp$, ^::strpbrk$, ^::strrchr$, ^::strspn$, ^::strstr$, + ^::wcscmp$, ^::access$, ^::bind$, ^::connect$, ^:: diff time$, ^::dlsym$, + ^::fnmatch$, ^::getaddrinfo$, ^::getopt$, ^::htonl$, ^::htons$, + ^::iconv_open$, ^::inet_addr$, isascii$, isatty$, ^::mmap$, ^::newlocale$, + ^::openat$, ^::pathconf$, ^::pthread_equal$, ^::pthread_getspecific$, + ^::pthread_mutex_trylock$, ^::readdir$, ^::readlink$, ^::recvmsg$, + ^::regexec$, ^::scandir$, ^::semget$, ^::setjmp$, ^::shm_open$, ^::shmget$, + ^::sigismember$, ^::strcasecmp$, ^::strsignal$, ^::ttyname$`` - ``std::async()``. Not using the return value makes the call synchronous. - ``std::launder()``. Not using the return value usually means that the @@ -54,7 +57,8 @@ Options Semicolon-separated list of function return types to check. By default the following function return types are checked: - `::std::error_code`, `::std::error_condition`, `::std::errc`, `::std::expected`, `::boost::system::error_code` + `^::std::error_code$`, `^::std::error_condition$`, `^::std::errc$`, + `^::std::expected$`, `^::boost::system::error_code$` .. option:: AllowCastToVoid _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits