enabled and fixed modernize-use-auto clang-tidy warnings#6969
enabled and fixed modernize-use-auto clang-tidy warnings#6969firewave merged 4 commits intodanmar:mainfrom
modernize-use-auto clang-tidy warnings#6969Conversation
c9b94be to
ef37224
Compare
#include <set>
#include <type_traits>
namespace utils {
template<class T>
constexpr typename std::add_const<T>::type & as_const(T& t) noexcept
{
return t;
}
}
struct C
{
const int* f() const
{
const auto it = utils::as_const(v).find(0);
if (it == v.cend())
return nullptr;
return &(*it);
}
std::set<int> v;
};https://godbolt.org/z/91qxYYxcz If you remove the This happens because we try It seems like this might just be a false positive since everything seems to work fine and the CI is happy otherwise. |
|
These changes exposed a |
|
This is ready for review but keeping a draft so it does not interfere with the ValueFlow revert. |
danmar
left a comment
There was a problem hiding this comment.
please review if we can use range for loops in some of these loops.
| fd_set rfds; | ||
| FD_ZERO(&rfds); | ||
| for (std::list<int>::const_iterator rp = rpipes.cbegin(); rp != rpipes.cend(); ++rp) | ||
| for (auto rp = rpipes.cbegin(); rp != rpipes.cend(); ++rp) |
There was a problem hiding this comment.
this should be a range for loop right?
There was a problem hiding this comment.
It probably can - but so do others. modernize-loop-convert is currently disabled and that should report by it. Now that we have made more cleanups I will give that another spin.
There was a problem hiding this comment.
PR enabling that warning is coming up after this.
auto for iteratorsmodernize-use-auto clang-tidy warnings
No description provided.