New issue
Advanced search Search tips

Issue 718241 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

GC plugin: detect mismatch type / GC template base type

Project Member Reported by jsb...@chromium.org, May 4 2017

Issue description

Feature request:

Via copy/paste I ended up with this in some local code:

class SomeVeryLongTypeName
  : public GarbageCollected<SomeVeryLongType> {
  USING_GARBAGE_COLLECTED_MIXIN(SomeVeryLongTypeName)
public:
  ...
  DEFINE_VIRTUAL_TRACE();
  ...
}

Note the type name mismatch - SomeVeryLongTypeName vs. GarbageCollected<SomeVeryLongType>

This compiled just fine, and manifested as a crash when GC kicked in. Existing layout tests didn't catch it.

"It would be nice if..."

The clang plugin could detect a mismatch here and report an error.

This presumably could be generalized to handle RefCounted, ActiveScriptWrappable, etc - a list of types where you should not be specifying a templated base type that doesn't match the derived type.
 
Status: Available (was: Untriaged)

Sign in to add a comment