[PATCH] D18961: Add a readability-deleted-default clang-tidy check.
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 11 10:26:53 PDT 2016
I don't feel sufficiently strongly to insist - clang-tidy's mostly outside
my wheelhouse anyway.
As for how to go about it - my rough approach would be to write a small
test case that calls an implicitly-deleted-but-explicitly-defaulted move
op, run it, check the diagnostic text, find that in DiagnosticSemaKinds,
find where the diagnostic identifier is used in the code, set a breakpoint,
break there - then trace back to when/where it got marked as deleted (find
the member function of the AST node in question that is used to mark it as
deleted - break in there, with the condition that 'this ==' the specific
instance you're looking at, etc). Then see if, at the point at which the
thing is marked as deleted, you can check that it's not dependent (not a
template, etc) and emit the appropriate warning.
- Dave
On Mon, Apr 11, 2016 at 9:44 AM, Alex Pilkiewicz via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> pilki added a comment.
>
> In http://reviews.llvm.org/D18961#397163, @dblaikie wrote:
>
> > I'd consider just making this a compiler warning, perhaps?
>
>
> I honestly don't feel competent right now to write compiler warnings:
> clang-tidy has a nice, well defined interface. A compiler warning would
> force me to dig in the internals of clang. But if you feel strongly about
> it and give me a couple of pointers (like a diff that adds a similar
> warning, and maybe a pointer to the general area in the code where I would
> add it), I can maybe give it a try in the next few days/weeks.
>
>
> http://reviews.llvm.org/D18961
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160411/1f505f29/attachment.html>
More information about the cfe-commits
mailing list