Index: tools/clang/blink_gc_plugin/tests/stack_allocated.h |
diff --git a/tools/clang/blink_gc_plugin/tests/stack_allocated.h b/tools/clang/blink_gc_plugin/tests/stack_allocated.h |
index 8fe3241053ce9b88be142ec6dd065c9e87ca9a79..b1839b71e8ae4be0dbfd4480cd634f4ab42253da 100644 |
--- a/tools/clang/blink_gc_plugin/tests/stack_allocated.h |
+++ b/tools/clang/blink_gc_plugin/tests/stack_allocated.h |
@@ -9,7 +9,7 @@ |
namespace WebCore { |
-class HeapObject : public GarbageCollected<HeapObject> { }; |
+class HeapObject; |
class PartObject { |
DISALLOW_ALLOCATION(); |
@@ -23,6 +23,25 @@ private: |
HeapObject* m_obj; // Does not need tracing. |
}; |
+class AnotherStackObject : public PartObject { // Invalid base. |
+ STACK_ALLOCATED(); |
+private: |
+ StackObject m_part; // Can embed a stack allocated object. |
+}; |
+ |
+class HeapObject : public GarbageCollected<HeapObject> { |
+public: |
+ void trace(Visitor*); |
+private: |
+ StackObject m_part; // Cannot embed a stack allocated object. |
+}; |
+ |
+// STACK_ALLOCATED is inherited. |
+class DerivedStackObject : public StackObject { |
+private: |
+ AnotherStackObject m_anotherPart; // Also fine. |
+}; |
+ |
} |
#endif |