Without this change, code such as "f(/*param=*/1_op)" will check the
comment twice, once for the parameter of f (correct) and once for
the parameter of operator""_op (likely incorrect). The change removes
only the second check.
Reviewed By: njames93, LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D125885
void ArgumentCommentCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
- callExpr(unless(cxxOperatorCallExpr()),
+ callExpr(unless(cxxOperatorCallExpr()), unless(userDefinedLiteral()),
// NewCallback's arguments relate to the pointed function,
// don't check them against NewCallback's parameter names.
// FIXME: Make this configurable.
void i(const char *c);
void j(int a, int b, int c);
-double operator"" _km(long double);
+double operator"" _km(long double value);
void test() {
A a;
g((1));
// FIXME But we should not add argument comments here.
g(_Generic(0, int : 0));
+
+ 402.0_km;
}
void f(bool _with_underscores_);