2011/5/24 Argyrios Kyrtzidis <[email protected]>

> On May 21, 2011, at 5:31 AM, Matthieu Monrocq wrote:
>
> Your new diagnostic for non-virtual destructor looks great and useful, I'd
>> suggest we put it in "most" diagnostic group.
>>
>> Thanks for your work!
>>
>> -Argyrios
>>
>>
> Here is the new patch with the warning wired up in "most".
>
> I hope that the final attribute for classes will be implemented soon since
> it'll remove some false positives for this warning.
>
>
> It's already implemented, you can check it with
> cxxRecordDecl->hasAttr<FinalAttr>().
>
> -Argyrios
>
>
 Ah great! I had completely missed it...

I have reviewed the patch then, and taken the liberty of pasting the
paragraph of the Standard that specifies this just above the little piece of
code. I have also added the tests to `destructor.cpp`.

I have ordered the test so that  hasAttr<FinalAttr>  is the last condition,
in order to economize the calls (I suppose it's less costly than looking up
the destructor).

Since this means that I now specifies -std=c++0x on the command line (for
final), I would understand if it should only be activated conditionally or
if the test should be split.

-- Matthieu

Attachment: clang_non_virtual_destructor.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to