Files
o3de/Code/Tools/TestImpactFramework/Runtime
Chris Burel 41be03f193 Silence warning about unnecessary lambda captures with clang
The `unused-lambda-capture` will be triggered by the following code:

```cpp
void foo(int);
int main() {
    const int i = 0;
    auto l = [i](){foo(i);};
}
```

The issue here is that reading from the constant variable `i` does not
constitute an ODR-use, and consequently the variable does not have to be
captured. See
https://github.com/llvm/llvm-project/issues/34213#issuecomment-980987311
for a related discussion.

However, MSVC sees it differently.

In order to make both compilers happy, mark this variable with
`AZ_UNUSED`, since lambda captures can't be marked with attributes like
`[[maybe_unused]]`.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 21:49:41 -08:00
..