[PATCH] D118996: [clang-tidy] Support C++14 in bugprone-signal-handler.
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 26 01:51:37 PDT 2022
njames93 added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:453
+ diag(CallOrRef->getBeginLoc(),
+ "functions with other than C linkage are not allowed as signal "
+ "handler (until C++17)");
----------------
s/with other than/without
================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:472
+ StringRef Name = FoundS->getStmtClassName();
+ if (Name.startswith("CXX")) {
+ SourceRange R = getSourceRangeOfStmt(FoundS, Ctx);
----------------
This just feels very hacky and it's non exhaustive, would lambda for a start as that isn't prefixed internally with CXX.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:126
const LangOptions &LangOpts) const {
- // FIXME: Make the checker useful on C++ code.
- if (LangOpts.CPlusPlus)
+ if (LangOpts.CPlusPlus17)
return false;
----------------
Is this check valid on Objective-C code?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118996/new/
https://reviews.llvm.org/D118996
More information about the cfe-commits
mailing list