• Michael Lippautz's avatar
    cppgc: Check for correct base class inheritance · 143e6a74
    Michael Lippautz authored
    The only valid way to define a GCed type T is by inheriting from
    GarbageCollected<T>. Since this is prone to typos (see tests), add a
    simple check that covers most interesting use cases.
    
    The static assert covers
      A -> B -> GarbageCollected<C>
    
    The static assert does not cover
     A -> B -> C -> GarbageCollected<B>
    
    (In order to do so, we would need __direct_bases() support which is
    not yet available for C++.)
    
    Bug: pdfium:1670, chromium:1056170
    Change-Id: I494de48992f8ba9a1f0f9daad60584d828717403
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2810415Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
    Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#73854}
    143e6a74
Name
Last commit
Last update
..
internal Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
allocation.h Loading commit data...
common.h Loading commit data...
cross-thread-persistent.h Loading commit data...
custom-space.h Loading commit data...
default-platform.h Loading commit data...
ephemeron-pair.h Loading commit data...
explicit-management.h Loading commit data...
garbage-collected.h Loading commit data...
heap-consistency.h Loading commit data...
heap-state.h Loading commit data...
heap-statistics.h Loading commit data...
heap.h Loading commit data...
liveness-broker.h Loading commit data...
macros.h Loading commit data...
member.h Loading commit data...
name-provider.h Loading commit data...
object-size-trait.h Loading commit data...
persistent.h Loading commit data...
platform.h Loading commit data...
prefinalizer.h Loading commit data...
process-heap-statistics.h Loading commit data...
sentinel-pointer.h Loading commit data...
source-location.h Loading commit data...
testing.h Loading commit data...
trace-trait.h Loading commit data...
type-traits.h Loading commit data...
visitor.h Loading commit data...