aaron.ballman added inline comments.
================
Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:60
+ auto Diag =
+ diag(Loc, "use braced initializer list for constructing return types");
+
----------------
This diagnostic doesn't really tell the user what's wrong with the code. Why is
a braced init list better than another kind of initialization expression?
Perhaps: "to avoid repeating the return type from the declaration, use a braced
initializer list instead" or something along those lines?
================
Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:62
+
+ auto CallParensRange = MatchedConstructExpr->getParenOrBraceRange();
+
----------------
Please do not use `auto` here, the type is not explicitly spelled out in the
initialization.
================
Comment at: test/clang-tidy/modernize-return-braced-init-list.cpp:38
+ return Foo(b);
+}
----------------
We should probably have a test that ensures this code
```
[]() { return std::vector<int>({1, 2}); }();
```
does not get converted into this code
```
[]() { return {1, 2}; }();
```
Repository:
rL LLVM
https://reviews.llvm.org/D28768
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits