[llvm] r216170 - Make format_object_base's destructor protected and non-virtual.

David Blaikie dblaikie at gmail.com
Thu Aug 21 14:14:41 PDT 2014


On Thu, Aug 21, 2014 at 1:34 PM, Justin Bogner <mail at justinbogner.com> wrote:
> Benjamin Kramer <benny.kra at googlemail.com> writes:
>> Author: d0k
>> Date: Thu Aug 21 06:22:05 2014
>> New Revision: 216170
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=216170&view=rev
>> Log:
>> Make format_object_base's destructor protected and non-virtual.
>>
>> It's not meant to be used with operator delete and this avoids
>> emitting virtual dtors for every derived format object.
>
> This change is obviously for the better, but it triggers a warning when
> building with clang 3.4 (and probably every clang back to 2.9 or so),
> which is pretty unfortunate.
>
> The problem is, until r208449, we didn't know not to warn about this on
> final classes or when the destructor was protected. I'm not entirely
> sure what we should do here, but this is likely to break anyone who
> builds with -Werror for a while.

Only if they don't update their compiler - I usually just roll my
clang release compiler (disabling -Werror) when this sort of thing
comes up.

For those who want to use old/pre-installed/official release clangs
rather than more recent iterations, they can just disable -Werror
(it's not the default anyway).

I can't remember how much we jumped through when we first enabled
-Wcovered-switch-default - we might've had a version check to decide
whether to enable it (hmm, no, maybe we just had a "does the compiler
support this flag" check which is easier but not applicable to this
situation).

- David



More information about the llvm-commits mailing list