Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / destructor_access_finalized_field.cpp
blobb6bbfd22e5d8750580d649c7a1888c4c2730076e
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "destructor_access_finalized_field.h"
7 namespace blink {
9 HeapObject::~HeapObject()
11 // Valid access to fields.
12 if (m_ref->foo() && !m_obj) {
13 m_objs.size();
14 m_part.obj();
17 // Invalid access to fields.
18 bar(m_obj);
19 m_obj->foo();
20 m_objs[0];
23 void HeapObject::trace(Visitor* visitor)
25 visitor->trace(m_obj);
26 visitor->trace(m_objs);
27 visitor->trace(m_part);
30 void PartOther::trace(Visitor* visitor)
32 visitor->trace(m_obj);