[PATCH] Verify assign operator signatures.
Samuel Benzaquen
sbenza at google.com
Mon Dec 15 13:04:28 PST 2014
Good catch. I updated the change excluding private operators too.
On Mon, Dec 15, 2014 at 3:58 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:
> On Mon, Dec 15, 2014 at 3:22 PM, Samuel Benzaquen <sbenza at google.com>
> wrote:
> > Hi alexfh,
> >
> > Warn when the return type of assign operators is not Class&.
> >
> > http://reviews.llvm.org/D6667
> >
> > Files:
> > clang-tidy/google/AssignOperatorSignatureCheck.cpp
> > clang-tidy/google/AssignOperatorSignatureCheck.h
> > clang-tidy/google/CMakeLists.txt
> > clang-tidy/google/GoogleTidyModule.cpp
> > test/clang-tidy/google-assign-operator.cpp
> >
> > EMAIL PREFERENCES
> > http://reviews.llvm.org/settings/panel/emailpreferences/
>
> +struct Deleted {
> + // We don't check the return value of deleted operators.
> + void operator=(const Deleted&) = delete;
> + void operator=(Deleted&&) = delete;
> +};
>
> What about private declarations without a definition? Eg)
>
> class noncopyable {
> noncopyable(const noncopyable&);
> void operator=(const noncopyable&);
> };
>
> ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141215/e716fda8/attachment.html>
More information about the cfe-commits
mailing list