Commit b8be1451 by Jason Merrill Committed by Jason Merrill

PR c++/86342 - -Wdeprecated-copy and system headers.

	* decl2.c (cp_warn_deprecated_use): Don't warn about declarations
	in system headers.

From-SVN: r262231
parent 02fa47a9
2018-06-28 Jason Merrill <jason@redhat.com>
PR c++/86342 - -Wdeprecated-copy and system headers.
* decl2.c (cp_warn_deprecated_use): Don't warn about declarations
in system headers.
2018-06-27 David Malcolm <dmalcolm@redhat.com> 2018-06-27 David Malcolm <dmalcolm@redhat.com>
PR c++/86329 PR c++/86329
......
...@@ -5208,8 +5208,10 @@ cp_warn_deprecated_use (tree decl, tsubst_flags_t complain) ...@@ -5208,8 +5208,10 @@ cp_warn_deprecated_use (tree decl, tsubst_flags_t complain)
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
&& copy_fn_p (decl)) && copy_fn_p (decl))
{ {
warned = warning (OPT_Wdeprecated_copy, /* Don't warn about system library classes (c++/86342). */
"implicitly-declared %qD is deprecated", decl); if (!DECL_IN_SYSTEM_HEADER (decl))
warned = warning (OPT_Wdeprecated_copy,
"implicitly-declared %qD is deprecated", decl);
if (warned) if (warned)
{ {
tree ctx = DECL_CONTEXT (decl); tree ctx = DECL_CONTEXT (decl);
......
// PR c++/86342
// { dg-options -Wdeprecated-copy }
# 1 "deprcopy.cc"
# 1 "deprcopy.h" 1 3
struct X {
X() { }
~X() { }
};
# 2 "deprcopy.cc" 2
int main()
{
X x;
X y = x;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment