clang-tidy warnings with nested macros #748
-
I am seeing unexpected warnings from clang-tidy in my test code. It seems to boil down to variables being used in nested macros (e.g. For example, in a Is that a known issue, or am I having unreasonable expectations? I could not find anything in the issue tracker, but I thought I'd ask here first, as I don't have a clean MWE extracted from my codebase yet. I'm using doctest 2.4.10. Clang-tidy is being run on the code that was just used to run the test suite (on CI) , so I think I'm not hitting #691. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I managed to get a reproducer for the second kind of warning at least, // Compile with g++ myprogram.cpp
// Check with clang-tidy myprogram.cpp --config="" --
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
TEST_CASE("1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]")
{
int input;
int output;
Foo bla = Foo();
SUBCASE("Scenario A")
{
input = 3;
output = 6;
}
// more SUBCASEs here in reality...
// this line gives warning: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
CHECK(bla.factorial(input) == output);
} The first remains elusive to extract from my real project, I can't seem to figure out a way to build up a minimal reproducer (I want to avoid going top-down and successively removing stuff from the project, but maybe that's the only way). |
Beta Was this translation helpful? Give feedback.
-
Reported one of the problems as #761, the other is actually on my side to solve. |
Beta Was this translation helpful? Give feedback.
Reported one of the problems as #761, the other is actually on my side to solve.