llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-tools-extra Author: None (matthew-f) <details> <summary>Changes</summary> The regular expressions match functions that aren't anchored in the global namespace. For example `::connect` matches `QObject::connect` This change is to remove these false positives --- Full diff: https://github.com/llvm/llvm-project/pull/99084.diff 1 Files Affected: - (modified) clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp (+89-89) ``````````diff diff --git a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp index 73373147e96fc..955a9b94dfaf6 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp @@ -48,97 +48,97 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), CheckedFunctions(utils::options::parseStringList( - Options.get("CheckedFunctions", "::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$;" + Options.get("CheckedFunctions", "^::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$;" // C standard library - "::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$;" + "^::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$;" // POSIX - "::access$;" - "::bind$;" - "::connect$;" - "::difftime$;" - "::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"))), + "^::access$;" + "^::bind$;" + "^::connect$;" + "^::difftime$;" + "^::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"))), CheckedReturnTypes(utils::options::parseStringList( Options.get("CheckedReturnTypes", "::std::error_code$;" "::std::error_condition$;" `````````` </details> https://github.com/llvm/llvm-project/pull/99084 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits