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

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

Issue 564453002: Blink GC plugin: Check polymorphic requirements on all GC-derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and fix test error from previous CL Created 6 years, 3 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/polymorphic_class_with_non_virtual_trace.h
diff --git a/tools/clang/blink_gc_plugin/tests/polymorphic_class_with_non_virtual_trace.h b/tools/clang/blink_gc_plugin/tests/polymorphic_class_with_non_virtual_trace.h
index 3396c94553f5219cb6073bd9b81ad2da03f30f01..f5d999ebf6430a7eddc20c549c268f6c36b5143d 100644
--- a/tools/clang/blink_gc_plugin/tests/polymorphic_class_with_non_virtual_trace.h
+++ b/tools/clang/blink_gc_plugin/tests/polymorphic_class_with_non_virtual_trace.h
@@ -41,6 +41,21 @@ private:
Member<HeapObject> m_obj;
};
+template<typename T>
+class TemplatedNonPolymorphicBase
+ : public GarbageCollected<TemplatedNonPolymorphicBase<T> > {
+public:
+ void trace(Visitor* visitor) { visitor->trace(m_obj); }
+private:
+ Member<HeapObject> m_obj;
+};
+
+// Looks OK, but will result in an incorrect object pointer when marking.
+class TemplatedIsNotLeftMostPolymorphic
+ : public TemplatedNonPolymorphicBase<TemplatedIsNotLeftMostPolymorphic>,
+ public PolymorphicBase {
+};
+
}
#endif

Powered by Google App Engine
This is Rietveld 408576698