Commit 101bca19 authored by Reid Kleckner's avatar Reid Kleckner Committed by Commit Bot

Blink GC plugin: Fix tests after addition of const qual

[email protected], [email protected]

Bug: 1058608
Change-Id: I03330f4aecf276cf994cb34362e3605b616e3886
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088637Reviewed-by: default avatarReid Kleckner <[email protected]>
Commit-Queue: Reid Kleckner <[email protected]>
Cr-Original-Commit-Position: refs/heads/[email protected]{#747022}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5620ebf668ff058c4b581076b9cda73945569000
parent dd9231cb
......@@ -2,7 +2,7 @@ In file included from finalize_after_dispatch.cpp:5:
./finalize_after_dispatch.h:12:1: warning: [blink-gc] Class 'NeedsDispatch' is missing manual trace dispatch.
class NeedsDispatch : public GarbageCollected<NeedsDispatch> {
^
finalize_after_dispatch.cpp:30:1: warning: [blink-gc] Missing dispatch to class 'D' in manual finalize dispatch.
finalize_after_dispatch.cpp:28:1: warning: [blink-gc] Missing dispatch to class 'D' in manual finalize dispatch.
void A::FinalizeGarbageCollectedObject()
^
2 warnings generated.
......@@ -6,21 +6,22 @@
namespace blink {
static B* toB(A* a) { return static_cast<B*>(a); }
static const B* toB(const A* a) {
return static_cast<const B*>(a);
}
void A::Trace(Visitor* visitor)
{
switch (m_type) {
void A::Trace(Visitor* visitor) const {
switch (m_type) {
case TB:
toB(this)->TraceAfterDispatch(visitor);
break;
toB(this)->TraceAfterDispatch(visitor);
break;
case TC:
static_cast<C*>(this)->TraceAfterDispatch(visitor);
break;
static_cast<const C*>(this)->TraceAfterDispatch(visitor);
break;
case TD:
// Missing static_cast<D*>(this)->TraceAfterDispatch(visitor);
break;
}
// Missing static_cast<D*>(this)->TraceAfterDispatch(visitor);
break;
}
}
void A::TraceAfterDispatch(Visitor* visitor) const {}
......
......@@ -10,15 +10,16 @@
namespace blink {
class A : public GarbageCollected<A> {
public:
void Trace(Visitor*);
void TraceAfterDispatch(Visitor*) const;
public:
void Trace(Visitor*) const;
void TraceAfterDispatch(Visitor*) const;
protected:
enum Type { TB, TC, TD };
A(Type type) : m_type(type) {}
protected:
enum Type { TB, TC, TD };
A(Type type) : m_type(type) { }
private:
Type m_type;
private:
Type m_type;
};
class B : public A {
......
trace_after_dispatch.cpp:11:1: warning: [blink-gc] Missing dispatch to class 'D' in manual trace dispatch.
void A::Trace(Visitor* visitor)
trace_after_dispatch.cpp:13:1: warning: [blink-gc] Missing dispatch to class 'D' in manual trace dispatch.
void A::Trace(Visitor* visitor) const {
^
trace_after_dispatch.cpp:30:1: warning: [blink-gc] Base class 'A' of derived class 'B' requires tracing.
void B::TraceAfterDispatch(Visitor* visitor) const
trace_after_dispatch.cpp:29:1: warning: [blink-gc] Base class 'A' of derived class 'B' requires tracing.
void B::TraceAfterDispatch(Visitor* visitor) const {
^
trace_after_dispatch.cpp:38:1: warning: [blink-gc] Class 'C' has untraced fields that require tracing.
void C::TraceAfterDispatch(Visitor* visitor) const
trace_after_dispatch.cpp:36:1: warning: [blink-gc] Class 'C' has untraced fields that require tracing.
void C::TraceAfterDispatch(Visitor* visitor) const {
^
./trace_after_dispatch.h:36:5: note: [blink-gc] Untraced field 'm_a' declared here:
./trace_after_dispatch.h:40:5: note: [blink-gc] Untraced field 'm_a' declared here:
Member<A> m_a;
^
3 warnings generated.
......@@ -25,7 +25,7 @@ void TraceAfterDispatchExternBase::TraceAfterDispatch(Visitor* visitor) const {
Member<X> x_base_;
^
trace_after_dispatch_impl_error.cpp:38:1: warning: [blink-gc] Base class 'TraceAfterDispatchExternBase' of derived class 'TraceAfterDispatchExternDerived' requires tracing.
void TraceAfterDispatchExternDerived::TraceAfterDispatch(Visitor* visitor) const {
void TraceAfterDispatchExternDerived::TraceAfterDispatch(
^
trace_after_dispatch_impl_error.cpp:38:1: warning: [blink-gc] Class 'TraceAfterDispatchExternDerived' has untraced fields that require tracing.
./trace_after_dispatch_impl_error.h:70:3: note: [blink-gc] Untraced field 'x_derived_' declared here:
......
......@@ -2,7 +2,7 @@ In file included from virtual_and_trace_after_dispatch.cpp:5:
./virtual_and_trace_after_dispatch.h:12:1: warning: [blink-gc] Left-most base class 'A' of derived class 'B' must be polymorphic.
class A : public GarbageCollected<A> {
^
./virtual_and_trace_after_dispatch.h:23:1: warning: [blink-gc] Class 'B' contains or inherits virtual methods but implements manual dispatching.
./virtual_and_trace_after_dispatch.h:24:1: warning: [blink-gc] Class 'B' contains or inherits virtual methods but implements manual dispatching.
class B : public A {
^
./virtual_and_trace_after_dispatch.h:14:5: note: [blink-gc] Manual dispatch 'Trace' declared here:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment