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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
These tests aren't that great.
I'd advise adding a test that just checks using the userDefinedLiteral in bugprone-argument-comment-literals.cpp, That check file will add comments to parameters that don't have them.
That way you aren't testing against distinguishing between the actual parameter comment and the literal comment.
This simple edit without your fix results in this diff in the output, with your fix that diff wont exist.
[build] int operator""_op(unsigned long long Value); [build] [build] void test() { [build] - 1_op; [build] + /*Value=*/1_op;
Update test as suggested by njames93.
bugprone-argument-comment-literals.cpp also contains some instances of a UDL used as an argument which didn't lead to problems before because the argument didn't have a name. So that case is covered as well.
Would someone be able to commit this for me, as I do not have the necessary rights? Thanks