alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.
A couple of comments.
================
Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:35
+
+ auto HasConstructExpr = has(ConstructExpr);
+
----------------
Nit: I see no point in this variable. I'd merge `has` into either the matcher
above or the one below.
================
Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:74
+ dyn_cast<VarDecl>(MatchedFunctionDecl->getParamDecl(I))) {
+ if (MatchedConstructExpr->getArg(I)->getType().getCanonicalType() !=
+ VD->getType().getCanonicalType())
----------------
I wonder whether `MatchedConstructExpr` can have fewer arguments than the
declaration (e.g. when there are default arguments). Could you add a test with
default arguments and check whether this code works correctly?
Repository:
rL LLVM
https://reviews.llvm.org/D28768
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits