[Diagnostics] Put "deprecated copy" warnings into -Wdeprecated-copy
authorDávid Bolvanský <david.bolvansky@gmail.com>
Fri, 22 Nov 2019 21:37:07 +0000 (22:37 +0100)
committerDávid Bolvanský <david.bolvansky@gmail.com>
Fri, 22 Nov 2019 21:37:19 +0000 (22:37 +0100)
commit9353c5dd0664ea444236e527bf93566e11dc34df
tree7feded4967a9c68f6d4795c63beb643299d21c6e
parentc32f0ff92f024a8af438fc8d85906e441b5a2682
[Diagnostics] Put "deprecated copy" warnings into -Wdeprecated-copy

Summary:
GCC 9 added -Wdeprecated-copy (as part of -Wextra). This diagnostic is already implemented in Clang too, just hidden under -Wdeprecated (not on by default).
This patch adds -Wdeprecated-copy and makes it compatible with GCC 9+.
This diagnostic is heavily tested in deprecated.cpp, so I added simple tests just to check we warn when new flag/-Wextra is enabled.

Reviewers: rsmith, dblaikie

Reviewed By: dblaikie

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70342
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/deprecated-copy.cpp [new file with mode: 0644]