================
@@ -61,9 +69,28 @@ class ContributorFinder : public DynamicRecursiveASTVisitor {
   bool VisitLambdaExpr(LambdaExpr *L) override {
     // TraverseLambdaExpr directly visits the body stmt, skipping the
     // CXXMethodDecl, which is a contributor that needs to be collected.
+    // The system-header gate fires via the delegated VisitFunctionDecl
+    // (the call operator's spelling location is the lambda's source
+    // location), so no separate gate here.
----------------
steakhal wrote:

I find this behavior pretty common.
Handlers can do two things:
1) Delegate to a different handler - in which case it usually shouldn't do 
anything else, because it recursively decomposes something.
2) Or handle the case, where it should do the filtering and everything.

This mental pattern already suggests to me that there should not be a 
`skipForSystemHeader()` filter here. However, I could see that this implicit 
contract should be spelled out.

https://github.com/llvm/llvm-project/pull/205446
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to