[PATCH] D56160: [clang-tidy] modernize-use-trailing-return-type check
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 6 13:23:10 PDT 2019
aaron.ballman added inline comments.
================
Comment at: clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:85-87
+ if (TL.getQualifierLoc())
+ if (!TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()))
+ return false;
----------------
You can combine these.
================
Comment at: clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:88-90
+ if (!TraverseTypeLoc(TL.getNamedTypeLoc(), true))
+ return false;
+ return true;
----------------
And this can become `return TraverseTypeLoc(...);`
================
Comment at: clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:95-98
+ if (!S->getQualifierLoc() && Name.isIdentifier() &&
+ VisitUnqualName(Name.getAsIdentifierInfo()->getName()))
+ return false;
+ return true;
----------------
This can also be simplified into a single return statement rather than an `if`, but it's less clear to me whether that's an improvement. WDYT?
================
Comment at: clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:203
+ if (ContainsQualifiers + ContainsSpecifiers + ContainsSomethingElse > 1)
+ return {};
+
----------------
This should return `llvm::None`
================
Comment at: clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:234
+ diag(F.getLocation(), Message);
+ return {};
+ }
----------------
`llvm::None`
================
Comment at: clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:246
+ diag(F.getLocation(), Message);
+ return {};
+ }
----------------
`llvm::None`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56160/new/
https://reviews.llvm.org/D56160
More information about the cfe-commits
mailing list