Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: tools/clang/blink_gc_plugin/tests/stack_allocated.h

Issue 206123004: Add checks for stack-allocated types and their uses in fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..70ce8a244a4f5ad078aed7c3b79caef2ab107085 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,23 @@ 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.
+};
+
+class DerivedStackObject : public StackObject {
+ // Missing STACK_ALLOCATED();
+};
+
}
#endif

Powered by Google App Engine
This is Rietveld 408576698