Go to file
Roman Lebedev 61061d69ea [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)
Summary:
This has just bit me, so i though it would be nice to avoid that next time :)
Motivational case:
  https://godbolt.org/g/cq9UNk
Basically, it's likely to happen if you don't like shadowing issues,
and use `-Wshadow` and friends. And it won't be diagnosed by clang.

The reason is, these self-assign diagnostics only work for builtin assignment
operators. Which makes sense, one could have a very special operator=,
that does something unusual in case of self-assignment,
so it may make sense to not warn on that.

But while it may be intentional in some cases, it may be a bug in other cases,
so it would be really great to have some diagnostic about it...

Reviewers: aaron.ballman, rsmith, rtrieu, nikola, rjmccall, dblaikie

Reviewed By: rjmccall

Subscribers: EricWF, lebedev.ri, thakis, Quuxplusone, cfe-commits

Differential Revision: https://reviews.llvm.org/D44883

llvm-svn: 329493
2018-04-07 10:39:21 +00:00
clang [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes) 2018-04-07 10:39:21 +00:00
clang-tools-extra [clang-tidy] One more fix compilation for ParentVirtualCallCheck.cpp: find_if predicate 2018-04-06 21:00:18 +00:00
compiler-rt [libFuzzer] Print a correct error message when a directory can't be 2018-04-06 18:15:24 +00:00
debuginfo-tests [Darwin] Specify DWARF 2/4 when running apple accelerator tests. 2018-02-26 20:56:45 +00:00
libclc select: simplify implementation and fix fp16 2018-04-06 22:00:00 +00:00
libcxx [libcxx][test] Silence -Wself-assign diagnostics 2018-04-07 10:36:03 +00:00
libcxxabi [CMake] Support for monorepo layout 2018-04-04 17:40:59 +00:00
libunwind [cmake] Remove duplicate command line options from build 2018-04-05 20:27:50 +00:00
lld [tests] Fix format-binary-non-ascii.s to work with Python 3 on Windows 2018-04-07 00:55:26 +00:00
lldb [lldb-server] Set a more generous timeout when testing gdbremote. 2018-04-06 17:17:20 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [InstCombine] Get rid of select of bittest (PR36950 / PR17564) 2018-04-07 10:37:24 +00:00
openmp [OpenMP] enable bc file compilation using the latest clang 2018-04-03 15:01:34 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [doc] Overhaul doc on preparing IR for processing by Polly. 2018-04-06 19:24:18 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.