ladybird/Tests/ClangPlugins/LibJSGCTests/wrapping_non_cell_member.cpp
Andreas Kling 3bfb0534be LibGC: Rename MarkedVector => RootVector
Let's try to make it a bit more clear that this is a Vector of GC roots.
2024-12-26 19:10:44 +01:00

21 lines
597 B
C++

/*
* Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
// RUN: %clang++ -cc1 -verify %plugin_opts% %s 2>&1
#include <LibGC/Ptr.h>
#include <LibGC/RootVector.h>
struct NotACell { };
class TestClass {
// expected-error@+1 {{Specialization type must inherit from GC::Cell}}
GC::Ptr<NotACell> m_member_1;
// expected-error@+1 {{Specialization type must inherit from GC::Cell}}
GC::Ref<NotACell> m_member_2;
// expected-error@+1 {{Specialization type must inherit from GC::Cell}}
GC::RawPtr<NotACell> m_member_3;
};