This diff extracts the matcher for an unused expression result from bugprone-unused-return-value into a utility. This diff is a prerequisite to D133804 which introduces
the cuda-unsafe-api-call-check
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I feel like this matcher could do with some unit testing. I'd say create a test file in clang-tools-extra/unittests/clang-tidy/MatchersTest.cpp
clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp | ||
---|---|---|
143–144 | Can all these be removed now? |
clang-tools-extra/unittests/clang-tidy/MatchersTest.cpp | ||
---|---|---|
2 |
@njames93 that's correct. But I don't recall the patch ID :/
I don't know if the file is found then but it would make standalone builds certainly easier. I'm not sure if I calculate correctly but given: clang-tools-extra/unittests/clang-tidy/MatchersTest.cpp then ../../ means clang-tools-extra/, no? If so, that directory doesn't contain a clang directory here. It seems as if the ../../ is relative to some other directory but not this file. Or am I too tired to get it? |
clang-tools-extra/unittests/clang-tidy/MatchersTest.cpp | ||
---|---|---|
2 | I'll test when I get a few cycles. If not, may need to copy some of the testing logic for this. |
clang-tools-extra/unittests/clang-tidy/MatchersTest.cpp | ||
---|---|---|
2 | Yes, the tests do indeed work but it's probably because it's getting the include path from another directory. I was actually thinking of adding the directory for clang as an include path within cmake but thought this would be better. There is also an option of copying the testing setup from clang and pasting it here, or to just create testing checks and use the existing check testing utilities to run the matchers inside of those checks. What do you reckon is the best solution in that case to the problem of standalone builds? |
Can all these be removed now?