Skip to content

Commit

Permalink
[clang-tidy] Ensure functions are anchored in the global namespace (#…
Browse files Browse the repository at this point in the history
…99084)

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
  • Loading branch information
matthew-f authored Jul 17, 2024
1 parent c077a4f commit c736ca8
Showing 1 changed file with 89 additions and 89 deletions.
178 changes: 89 additions & 89 deletions clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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$;"
Expand Down

0 comments on commit c736ca8

Please sign in to comment.