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

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

Issue 2060553002: GC plugin: improve error reporting when tracing illegal fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: robustify namespace equality checking instead Created 4 years, 6 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/fields_illegal_tracing.h
diff --git a/tools/clang/blink_gc_plugin/tests/fields_illegal_tracing.h b/tools/clang/blink_gc_plugin/tests/fields_illegal_tracing.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d9e692ac7f4ad72c7bf321a3e134b42d50b98f8
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/fields_illegal_tracing.h
@@ -0,0 +1,56 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FIELDS_ILLEGAL_TRACING_H_
+#define FIELDS_ILLEGAL_TRACING_H_
+
+#include "heap/stubs.h"
+
+namespace blink {
+
+namespace bar {
+
+// check that (only) std::unique_ptr<> is reported
+// as an illegal smart pointer type.
+template<typename T> class unique_ptr {
+public:
+ ~unique_ptr() { }
+ operator T*() const { return 0; }
+ T* operator->() { return 0; }
+
+ void trace(Visitor* visitor)
+ {
+ }
+};
+
+}
+
+class HeapObject;
+class PartObject;
+
+class PartObject {
+ DISALLOW_ALLOCATION();
+public:
+ void trace(Visitor*);
+private:
+ OwnPtr<HeapObject> m_obj1;
+ RefPtr<HeapObject> m_obj2;
+ bar::unique_ptr<HeapObject> m_obj3;
+ std::unique_ptr<HeapObject> m_obj4;
+};
+
+class HeapObject : public GarbageCollectedFinalized<HeapObject> {
+public:
+ void trace(Visitor*);
+private:
+ PartObject m_part;
+ OwnPtr<HeapObject> m_obj1;
+ RefPtr<HeapObject> m_obj2;
+ bar::unique_ptr<HeapObject> m_obj3;
+ std::unique_ptr<HeapObject> m_obj4;
+};
+
+}
+
+#endif
« no previous file with comments | « tools/clang/blink_gc_plugin/TracingStatus.h ('k') | tools/clang/blink_gc_plugin/tests/fields_illegal_tracing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698