File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
clang/test/Analysis/Checkers/WebKit Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ class HashMap {
7070 HashMap ([[clang::noescape]] const Function<ValueType()>&);
7171 void ensure (const KeyType&, [[clang::noescape]] const Function<ValueType()>&);
7272 bool operator +([[clang::noescape]] const Function<ValueType()>&) const ;
73+ static void ifAny (HashMap, [[clang::noescape]] const Function<bool (ValueType)>&);
7374
7475private:
7576 ValueType* m_table { nullptr };
@@ -281,6 +282,7 @@ struct RefCountableWithLambdaCapturingThis {
281282 });
282283 }
283284
285+ static void callLambda ([[clang::noescape]] const WTF::Function<RefPtr<RefCountable>()>&);
284286 void method_captures_this_in_template_method () {
285287 RefCountable* obj = make_obj ();
286288 WTF::HashMap<int , RefPtr<RefCountable>> nextMap;
@@ -290,6 +292,12 @@ struct RefCountableWithLambdaCapturingThis {
290292 nextMap+[&] {
291293 return obj->next ();
292294 };
295+ WTF::HashMap<int , RefPtr<RefCountable>>::ifAny (nextMap, [&](auto & item) -> bool {
296+ return item->next () && obj->next ();
297+ });
298+ callLambda ([&]() -> RefPtr<RefCountable> {
299+ return obj->next ();
300+ });
293301 }
294302};
295303
You can’t perform that action at this time.
0 commit comments