r204825 - -Wglobal-constructors: Don't warn on trivial defaulted dtors

Reid Kleckner rnk at google.com
Wed Mar 26 15:40:16 PDT 2014


On Wed, Mar 26, 2014 at 3:10 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Wed, Mar 26, 2014 at 9:36 AM, Stephan Tolksdorf <st at quanttec.com>wrote:
>
>> Hi Reid,
>>
>> Did you overlook that I had assigned PR19253 to myself and posted a patch
>> to this list (D3190)? :-)
>>
>
Sorry, I was reading my inbox, not commit mail.  This looked super obvious,
so I went ahead.


> I think that fixing HasIrrelevantDestructor (as I did in my patch) would
>> be a better solution for this issue.
>
>
> I agree that we should fix HasIrrelevantDestructor. But... we shouldn't
> warn on a trivial destructor no matter whether it's public or whether it
> calls non-public destructors. hasIrrelevantDestructor is supposed to just
> be an optimization, and shouldn't affect our semantics. => We want both
> fixes :)
>
> Another test case, should not warn (under either of the two 'global
> destructor' warnings):
>
> class A {
>   friend struct B;
>   ~A() = default;
> };
> struct B {
>   ~B() = default;
> } b;
>

Is B supposed to inherit from A here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140326/c8de0546/attachment.html>


More information about the cfe-commits mailing list