Avoid printing informational notes when -Wmismatched-tags is suppressed in system...
authorMartin Sebor <msebor@redhat.com>
Tue, 7 Jul 2020 17:23:50 +0000 (11:23 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 7 Jul 2020 17:23:50 +0000 (11:23 -0600)
commit6f9c9ea40a1e937ea1b549625cf7762d4a8a2078
treef524fcd83c548ea7b9bb1b8b3a838663204e255f
parent2aeccecbf0d8c7e22926e0f740c46724da8a7be8
Avoid printing informational notes when -Wmismatched-tags is suppressed in system headers (PR c++/96063)

Related:
PR c++/96063 - mismatched-tags warnings in stdlib headers

gcc/cp/ChangeLog:

PR c++/96063
* parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
if warning_at returns nonzero.

gcc/testsuite/ChangeLog:

PR c++/96063
* g++.dg/warn/Wmismatched-tags-7.C: New test.
* g++.dg/warn/Wmismatched-tags-8.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/warn/Wmismatched-tags-7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C [new file with mode: 0644]