PiotrZSL requested changes to this revision.
PiotrZSL added a comment.
This revision now requires changes to proceed.

I got one concern, if you write this:

  template <typename... Ts>LIBC_INLINE void 
VariadicTemplate<Ts...>::goodVariadicTemplate() {}
  template <typename... Ts>inline void 
VariadicTemplate<Ts...>::badVariadicTemplate() {}

Aka, no space after `>`, warning will be emitted for both.
That's because of `TemplateParams->getRAngleLoc().getLocWithOffset(1);`
So we find `>` character, then we skip it, now we pointing into `inline` or 
whitespace location, and when we skip to a next token.
If you remove this `getLocWithOffset(1)` then `findNextTokenSkippingComments` 
should work correctly.

Additionally you missing release notes.
There is also other way to deal with this issue, simply use 
`FunctionDecl::getReturnTypeSourceRange()` and work with 
`tidy::utils::lexer::getPreviousToken`.
But in theory both solutions should work fine. Question is also how it will 
work with attributes, like `[[nodiscard]]` that could be put before inline.

Requesting change mainly due to false-positive with space.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153218

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

Reply via email to