Check for namespaces and lambda signal handler was added.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp | ||
---|---|---|
100–101 | What happens differently in c++17 and later? | |
137 | Why can't c++ linkage functions be used a signal handlers. | |
241–242 | Why can't lambdas be used as signal handlers, If they are stateless they can be implicitly converted to function pointers. Or is this something about needing C linkage? |
clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp | ||
---|---|---|
100–101 | The plan is to add later features to the checker that check different restrictions on the signal handler function. These restrictions may differ in C++14 and C++17 (cppreference.com tells about the difference too, and CERT rule MSC54-CPP). I do not want to make the checker valid for C++17 and later restrict it to C++14 again (if C++14 but not C++17 features are added). (It is not exactly clarified which aspects of the restrictions are to be checked in the checker.) In the current state the allowed callable functions seems to be the same for C++11 and later (this is defined by POSIX). | |
137 | The checker documentation will be fixed. For C++14 the "common subset of C and C++" is allowed to be used as signal handler (but not for C++17) and only C linkage. For C++17 it is not clear if C++ linkage is allowed, and it is not clear if calling functions with C++ linkage is allowed from the signal handler. | |
241–242 | I suspect that the problem is the C linkage. |
What happens differently in c++17 and later?