[cfe-commits] [cfe-dev] How to propose patches ?

Matthieu Monrocq matthieu.monrocq at gmail.com
Tue May 24 10:43:10 PDT 2011


2011/5/24 Argyrios Kyrtzidis <kyrtzidis at apple.com>

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110524/89a852b3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_non_virtual_destructor.diff
Type: application/octet-stream
Size: 6699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110524/89a852b3/attachment.obj>


More information about the cfe-commits mailing list