Issue Description
In the file leccalc/aggreports.cpp, at lines 1312‑1315, there is a variable shadowing issue that leads to the fileIDs vector remaining empty after the conditional block.
std::vector<int> fileIDs; // Outer declaration
if (outputFlags_[handles[WHEATSHEAF]] == true) {
std::vector<int> fileIDs = GetFileIDs(handles[WHEATSHEAF], PSEPT); // Inner declaration – shadows the outer one
}
// Here 'fileIDs' is still empty
The code currently declares std::vector<int> fileIDs outside an if block, then inside the block re‑declares a new local variable with the same name (std::vector<int> fileIDs = ...).
This local variable inside the if scope is destroyed when the block ends, leaving the outer fileIDs unchanged (still empty). Later code that depends on fileIDs being populated will therefore fail or behave incorrectly.
Expected behavior
The inner assignment should modify the outer fileIDs variable, not create a new local one.
Issue Description
In the file
leccalc/aggreports.cpp, at lines 1312‑1315, there is a variable shadowing issue that leads to thefileIDsvector remaining empty after the conditional block.The code currently declares
std::vector<int> fileIDsoutside anifblock, then inside the block re‑declares a new local variable with the same name (std::vector<int> fileIDs = ...).This local variable inside the if scope is destroyed when the block ends, leaving the outer fileIDs unchanged (still empty). Later code that depends on fileIDs being populated will therefore fail or behave incorrectly.
Expected behavior
The inner assignment should modify the outer fileIDs variable, not create a new local one.