https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87387
Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egallager at gcc dot gnu.org See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=53129 --- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> --- (In reply to David Binderman from comment #1) > I found this bug by compiling gcc with the new clang 7.0 > > It seems that gcc can't be encouraged to warn about self-assignment. > > For example: > > $cat sep23a.cc > // -Wself-assign. clang has it. gcc doesn't. > > extern void g( int); > > void f(int n) > { > int m = 2 * n; > > m = m; > > g( m); > } > > $ ~/gcc/results/bin/gcc -c -O2 -Wall -Wextra sep23a.cc > $ > > Given that this warning finds bugs in gcc itself, would this > -Wself-assign warning be worth implementing in gcc ? That's bug 53129. > > I'll have a go at compiling the rest of the world with clang-7.0 > and see what it finds.