[Diagnostics] Restore -Wdeprecated warning when user-declared copy assignment operator is defined as deleted (PR45634)

Solves https://bugs.llvm.org/show_bug.cgi?id=45634
Be more agressive than GCC with -Wdeprecated-copy. Also provide -W(no-)deprecated-copy-user-provided-copy/dtor options to on/off this behaviour.

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D79714
diff --git a/clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp b/clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp
new file mode 100644
index 0000000..4f259ca
--- /dev/null
+++ b/clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify
+// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-copy -verify
+
+struct A {
+  A &operator=(const A &); // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-provided copy assignment operator}}
+};
+
+void foo() {
+  A a1;
+  A a2(a1); // expected-note {{implicit copy constructor for 'A' first required here}}
+}