aaron.ballman added a comment.

In D96082#2566984 <https://reviews.llvm.org/D96082#2566984>, @steveire wrote:

> In D96082#2565339 <https://reviews.llvm.org/D96082#2565339>, @aaron.ballman 
> wrote:
>
>> A somewhat similar check that would be interesting is a function that 
>> returns the same value on all control paths
>
> I think we shouldn't try to design a new, different check in the comments of 
> this MR.

I wasn't. I was giving an example of what is similar and I would find 
acceptable so that the code author has more data from which to make decisions 
about their patch.

> I think it would be better to finalize what to do with this one.
>
> Request further work to also change expressions in all affected TUs? Or close?

I don't think requesting further work would solve any of my concerns short of 
making a rather different check, so my preference is to close.

In D96082#2567143 <https://reviews.llvm.org/D96082#2567143>, @LukasHanel wrote:

> As a follow-up to this checker, clang -Wdocumentation does not understand the 
> `@retval` command.
> I was thinking of adding a new clang-tidy checker for this to verify/complete 
> the list of documented return values.
> In this case where the documentation does not say `@retval 0 always`, than I 
> will come back to the checker here, suggest make the function void or add the 
> "always" to the text :).
> The work with the useless-return-value was a study towards this new @retval 
> checker.

That's an interesting idea -- we don't have any clang-tidy checks related to 
documentation comments currently, but the doxygen-style comments are the only 
form of comment to be retained in the AST. So it seems plausible to write 
clang-tidy checkers for documentation comments. However, you should know that 
there are limitations to this given that clang-tidy works most effectively with 
ASTs and not the user's original source -- it's trivially easy to lose some or 
all of the AST nodes for the comments if the formatting gets mucked up: 
https://godbolt.org/z/nWcMsM So it is possible that it's easier to do this work 
in the frontend instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96082/new/

https://reviews.llvm.org/D96082

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to