ladybird/Tests/ClangPlugins/LibJSGCTests/gc_allocated_member_is_accessed.cpp
2025-05-12 16:00:55 -04:00

24 lines
593 B
C++

/*
* Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
// RUN: %clang++ -Xclang -verify %plugin_opts% -c %s -o %t 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);
// FIXME: It might be nice to check that the object is specifically passed to .visit() or .ignore()
(void)m_object;
}
GC::Ptr<JS::Object> m_object;
};