-Wmissing-attributes: check that we avoid duplicates and false positives
authorAlexandre Oliva <oliva@adacore.com>
Thu, 18 Jul 2019 00:38:45 +0000 (00:38 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 18 Jul 2019 00:38:45 +0000 (00:38 +0000)
commitdea78431676f0104f5467788e8e78fc05c3ab981
treeb343f18a6534f518028fdf53783d6d934389ab2d
parent8ea3c020a234e25d4a976e69902208f744c0819c
-Wmissing-attributes: check that we avoid duplicates and false positives

The initial patch for PR 81824 fixed various possibilities of
-Wmissing-attributes reporting duplicates and false positives.  The
test that avoided them was a little obscure, though, so this patch
rewrites it into a more self-evident form.

The patch also adds a testcase that already passed, but that
explicitly covers some of the possibilities of reporting duplicates
and false positives that preexisting tests did not cover.

for  gcc/ChangeLog

PR middle-end/81824
* attribs.c (decls_mismatched_attributes): Simplify the logic
that avoids duplicates and false positives.

for  gcc/testsuite/ChangeLog

PR middle-end/81824
* g++.dg/Wmissing-attributes-1.C: New.  Some of its fragments
are from Martin Sebor.

From-SVN: r273563
gcc/ChangeLog
gcc/attribs.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/Wmissing-attributes-1.C [new file with mode: 0644]