mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
34c9cee380
Do not allow thread_local vars with non-trivial destructors
24 lines
869 B
C++
24 lines
869 B
C++
// Copyright (c) 2023 Bitcoin Developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#include "logprintf.h"
|
|
#include "nontrivial-threadlocal.h"
|
|
|
|
#include <clang-tidy/ClangTidyModule.h>
|
|
#include <clang-tidy/ClangTidyModuleRegistry.h>
|
|
|
|
class BitcoinModule final : public clang::tidy::ClangTidyModule
|
|
{
|
|
public:
|
|
void addCheckFactories(clang::tidy::ClangTidyCheckFactories& CheckFactories) override
|
|
{
|
|
CheckFactories.registerCheck<bitcoin::LogPrintfCheck>("bitcoin-unterminated-logprintf");
|
|
CheckFactories.registerCheck<bitcoin::NonTrivialThreadLocal>("bitcoin-nontrivial-threadlocal");
|
|
}
|
|
};
|
|
|
|
static clang::tidy::ClangTidyModuleRegistry::Add<BitcoinModule>
|
|
X("bitcoin-module", "Adds bitcoin checks.");
|
|
|
|
volatile int BitcoinModuleAnchorSource = 0;
|