[PATCH] D42116: [clang-tidy] Adding Fuchsia checker for trailing returns

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 10:53:53 PST 2018


aaron.ballman added a comment.

Can you give some background on what problem the coding standard is trying to avoid by banning this? For instance, if trailing return types are bad, are deduced return types similarly bad, or are those fine?



================
Comment at: clang-tidy/fuchsia/TrailingReturnCheck.cpp:32-33
+void TrailingReturnCheck::check(const MatchFinder::MatchResult &Result) {
+  if (const auto *D = Result.Nodes.getNodeAs<Decl>("decl"))
+    diag(D->getLocStart(), "trailing returns are disallowed");
+}
----------------
I think more work needs to be done here. The coding standard explicitly mentions that trailing return types are allowed when the type is un-utterable without the trailing return type.


https://reviews.llvm.org/D42116





More information about the cfe-commits mailing list