[PATCH] D56160: [clang-tidy] modernize-use-trailing-return check
Bernhard Manfred Gruber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 27 06:56:41 PST 2019
bernhardmgruber updated this revision to Diff 188528.
bernhardmgruber marked 2 inline comments as done.
bernhardmgruber added a comment.
Herald added a subscriber: jdoerfert.
- rebased onto current master
- implemented a basic check for name collisions of unqualified names in the return type with function arugment names using RecursiveASTVisitor
- moved retrieval of `FunctionTypeLoc` out of `findTrailingReturnTypeSourceLocation()`
- replaced `F.getReturnType().hasLocalQualifiers()` by custom function `hasAnyNestedLocalQualifiers()`, as the former does not work if the qualifiers are not on the topmost type. E.g.: `const int*`. This is a PointerType without qualifiers, the const qualifier is part of the nested pointee type.
- inhibiting the rewrite, if the topmost return type is a `decltype` expression. the source range in this case does not include the expression in parenthesis after the `decltype`
- inserting an additional space after `auto` in case there was no space between the return type and the function name. E.g.: `int*f();`
- extended documentation with known limitations
- added more tests
CHANGES SINCE LAST ACTION
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 41827 bytes
Desc: not available
More information about the cfe-commits