[PATCH] D148697: [clang-tidy] Add more checks for functions which should be noexcept
André Schackier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 13 11:24:27 PDT 2023
AMS21 added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/performance/NoexceptSwapCheck.cpp:21
+ Finder->addMatcher(
+ functionDecl(unless(isImplicit()), unless(isDeleted()), hasName("swap"))
+ .bind("decl"),
----------------
PiotrZSL wrote:
> i dont think that swap functions can be deleted
All functions can be deleted. See [cppreference](https://en.cppreference.com/w/cpp/language/function#Deleted_functions)
```
void swap(int, int) = delete;
```
Should be valid C++ and not give a no-noexcept warning, so we need to exclude it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148697/new/
https://reviews.llvm.org/D148697
More information about the cfe-commits
mailing list