[PATCH] D28768: [clang-tidy] Add check 'modernize-return-braced-init-list'

Malcolm Parsons via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 16 03:55:00 PST 2017


malcolm.parsons added a comment.

What happens if the function has `auto` as the return type?



================
Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:23
+void ReturnBracedInitListCheck::registerMatchers(MatchFinder *Finder) {
+  // Only register the matchers for C++.
+  if (!getLangOpts().CPlusPlus)
----------------
C++11?


================
Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:37
+      functionDecl(isDefinition(), // Declarations don't have return statements.
+                   returns(recordType()), // We onnly care about record types.
+                   hasDescendant(returnStmt(hasDescendant(ctorAsArgument))))
----------------
typo - only.


Repository:
  rL LLVM

https://reviews.llvm.org/D28768





More information about the cfe-commits mailing list