On Thu, May 29, 2014 at 12:27 AM, Daniel Holbert <dholb...@mozilla.com> wrote:
> For now, our code isn't clean enough for this sort of static_assert to
> be doable. :-/ And we have at least one instance of a refcounted class
> that's semi-intentionally (albeit carefully) declared on the stack:
> gfxContext, per https://bugzilla.mozilla.org/show_bug.cgi?id=742100
>
> Still, the static_assert could be a good way of finding (in a local
> build) all the existing refcounted classes that want a non-public
> destructor, I suppose.

You could also specifically list the exceptions in the static_assert
expression, so that it would catch any new additions unless they were
added to the list of exceptions.  (It would be good hygiene to also
static_assert that the exceptions *are* destructible, so that if
that's ever fixed they can be removed from the exception list.)
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to