ClangPlugins: Remove confusing hasType check for lambda capture types

This check asserts that templated types will never escape. Which doesn't
hold up at all in practice.
This commit is contained in:
Andrew Kaster 2024-12-09 19:51:05 -07:00 committed by Andreas Kling
parent 2f38c83caf
commit 85b87508bf
Notes: github-actions[bot] 2024-12-10 06:13:49 +00:00

View file

@ -84,12 +84,7 @@ public:
unless(hasParent(
// <lambda struct>::operator()(...)
cxxOperatorCallExpr(has(declRefExpr(to(equalsBoundNode("lambda")))))))))),
parmVarDecl(
allOf(
// It's important that the parameter has a RecordType, as a templated type can never escape its function
hasType(cxxRecordDecl()),
hasAnnotation("serenity::escaping")))
.bind("lambda-param-ref")))),
parmVarDecl(hasAnnotation("serenity::escaping")).bind("lambda-param-ref")))),
this);
}