C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 12:
[12.1] What is "self assignment"?

Self assignment is when someone assigns an object to itself. For example,

#include "Fred.h"  // Defines class Fred

void userCode(Fred& x)
{
  x = x;           // Self-assignment
}
Obviously no one ever explicitly does a self assignment like the above, but since more than one pointer or reference can point to the same object (aliasing), it is possible to have self assignment without knowing it:
#include "Fred.h"  // Defines class Fred

void userCode(Fred& x, Fred& y)
{
  x = y;           // Could be self-assignment if &x == &y
}

int main()
{
  Fred z;
  userCode(z, z);
  ...
}