llvm-project
llvm-project copied to clipboard
multiple `readability-named-parameter` warnings not reported at once with line breaks in function signature
#include <string>
class A {
public:
A() {}
virtual ~A() {}
virtual void f(const std::string &a, const char b[], const std::size_t c);
};
class B : public A {
public:
void f(const std::string&, // warning
const char[], // no warning
const std::size_t) override {} // no warning
};
class C : public A {
public:
void f(const std::string&, const char[], const std::size_t) override {} // warning
};
<source>:13:30: warning: all parameters should be named in a function [readability-named-parameter]
void f(const std::string&, // warning
^
/*a*/
<source>:20:30: warning: all parameters should be named in a function [readability-named-parameter]
void f(const std::string&, const char[], const std::size_t) override {} // warning
^
/*a*/ /*b*/ /*c*/
https://godbolt.org/z/o9WdWGqrh
If you fix the warning in line 13 and run it again it will report the one in line 14 and so on.
@llvm/issue-subscribers-clang-tidy
Actually check works correctly, it produces warning for first unnamed, but fixes for all of them. probably it could be changed to provide separate warning, but still message refers to all parameters, not 'xyz' parameter.