[Bug libstdc++/98605] [8/9/10 Regression] clang-tidy error parsing <mutex> on libstdc++-v3

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 13 15:10:26 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98605

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:283c218a4846075c549f0215d6883e577b26e845

commit r8-10726-g283c218a4846075c549f0215d6883e577b26e845
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jan 13 11:03:58 2021 +0000

    libstdc++: Fix clang analyzer suppression [PR 98605]

    The fix for PR libstdc++/82481 should only have applied for targets
    where _GLIBCXX_HAVE_TLS is defined. Because it was also done for non-TLS
    targets, it isn't possible to use clang's analyzers on non-TLS targets
    if the code uses <mutex>. This fixes it by using a NOLINT comment on
    the relevant line instead of testing #ifdef __clang_analyzer__ and
    compiling different code when analyzing.

    I'm not actually able to reproduce the analyzer warning with the tools
    from Clang 10.0.1 so I'm not going to try to make the suppression more
    specific with NOLINTNEXTLINE(clang-analyzer-code.StackAddressEscape).

    libstdc++-v3/ChangeLog:

            PR libstdc++/98605
            * include/std/mutex (call_once): Use NOLINT to suppress clang
            analyzer warnings.

    (cherry picked from commit 8d3636923a309074eb19240ebaa30c1a0801eaaf)


More information about the Gcc-bugs mailing list