[PATCH] D69238: Fix clang-tidy readability-redundant-string-init for c++17/c++2a
Conrad Poelman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 8 17:17:56 PST 2019
poelmanc added a comment.
In D69238#1739429 <https://reviews.llvm.org/D69238#1739429>, @gribozavr2 wrote:
> If it is indeed the extra AST node for the elidable constructor, see if you can use the `ignoringElidableConstructorCall` AST matcher to ignore it, therefore smoothing over AST differences between language modes.
Thanks for the tip. Adding `ignoringElidableConstructorCall` in front of `cxxConstructExpr` for the `EmptyStringCtorExpr` and `EmptyStringCtorExprWithTemporaries` in RedundantStringInitCheck.cpp resulted in the checker no longer matching any of `std::string a = ""` lines, i.e. basically disabling the check for those types of lines.
Is there a tool to print the AST? That would show whether the AST already has some expression with the right SourceRange.
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69238/new/
https://reviews.llvm.org/D69238
More information about the cfe-commits
mailing list