ladybird/Tests/ClangPlugins/LibJSGCTests/gc_allocated_member_is_visited.cpp

23 lines
483 B
C++
Raw Normal View History

2024-04-16 03:07:30 +00:00
/*
* Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
// RUN: %clang++ -cc1 -verify %plugin_opts% %s 2>&1
// expected-no-diagnostics
#include <LibJS/Runtime/Object.h>
class TestClass : public JS::Object {
JS_OBJECT(TestClass, JS::Object);
virtual void visit_edges(Visitor& visitor) override
{
Base::visit_edges(visitor);
visitor.visit(m_object);
}
JS::GCPtr<JS::Object> m_object;
};