diff options
author | Jason Merrill <jason@redhat.com> | 2021-04-27 17:13:39 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-06-01 11:35:47 -0400 |
commit | 620cd7861e1266991c9c2a82e1e2d5f4d723ec88 (patch) | |
tree | 107b4735c89087ccbfe98dedeff16a1841bc7ba2 /gcc/tree-ssa-phiopt.c | |
parent | 18b88412069f51433e1b4f440d3c035bfc7b5cca (diff) | |
download | gcc-620cd7861e1266991c9c2a82e1e2d5f4d723ec88.zip gcc-620cd7861e1266991c9c2a82e1e2d5f4d723ec88.tar.gz gcc-620cd7861e1266991c9c2a82e1e2d5f4d723ec88.tar.bz2 |
c++: -Wdeprecated-copy and #pragma diagnostic [PR94492]
-Wdeprecated-copy was depending only on the state of the warning at the
point where we call the function, making it hard to use #pragma diagnostic
to suppress the warning for a particular implicitly declared function.
But checking whether the warning is enabled at the location of the implicit
declaration turned out to be a bit complicated; option_enabled only tests
whether it was enabled at the start of compilation, the actual test only
existed in the middle of diagnostic_report_diagnostic. So this patch
factors it out and adds a new warning_enabled function to diagnostic.h.
gcc/ChangeLog:
PR c++/94492
* diagnostic.h (warning_enabled_at): Declare.
* diagnostic.c (diagnostic_enabled): Factor out from...
(diagnostic_report_diagnostic): ...here.
(warning_enabled_at): New.
gcc/cp/ChangeLog:
PR c++/94492
* decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
gcc/testsuite/ChangeLog:
PR c++/94492
* g++.dg/cpp0x/depr-copy4.C: New test.
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
0 files changed, 0 insertions, 0 deletions