This is part of the fix of clang-tidy patterns to adapt to newly added ExprWithCleanups node.
Details
Diff Detail
Event Timeline
Also, please add documentation to the matcher definition and regenerate the documentation.
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
629 | This documentation is used to generate the public docs, so it should include examples with matchers (of what does and does not match). It's especially important because this AST matcher may not be obvious to everyone as to why you'd use it or what it applies to. | |
633 | Should be auto * (possibly const-qualified if you can get away with it). |
I was wondering why we didn't created that Matcher: IgnoreImplicit
I believe it's more commonly used than 'ignoringExprWithCleanups'.
It can be implemented by calling 'Stmt.IgnoreImplicit'.
/// Skip past any implicit AST nodes which might surround this /// statement, such as ExprWithCleanups or ImplicitCastExpr nodes. Stmt *IgnoreImplicit();
unittests/ASTMatchers/ASTMatchersTraversalTest.cpp | ||
---|---|---|
2018 ↗ | (On Diff #60704) | nit: you can lift that expression to a local variable: varDecl(hasInitializer(ignoringExprWithCleanups( ignoringParenImpCasts(integerLiteral())))))) It's used 3 times. |
I was wondering why we didn't created that Matcher: IgnoreImplicit
Actually you are right. There already exists a IgnoreImplict in clang-tidy and I just switched to that.
Abandoning this patch.
Thanks!
This documentation is used to generate the public docs, so it should include examples with matchers (of what does and does not match). It's especially important because this AST matcher may not be obvious to everyone as to why you'd use it or what it applies to.