diff --git a/Code/Framework/AzCore/Tests/DOM/DomPatchBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomPatchBenchmarks.cpp index e44ba3ce67..d67597255f 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomPatchBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomPatchBenchmarks.cpp @@ -78,7 +78,7 @@ namespace AZ::Dom::Benchmark if (apply) { auto patchInfo = GenerateHierarchicalDeltaPatch(m_before, m_after); - for (auto _ : state) + for ([[maybe_unused]] auto _ : state) { auto patchResult = patchInfo.m_forwardPatches.Apply(m_before); benchmark::DoNotOptimize(patchResult); @@ -86,7 +86,7 @@ namespace AZ::Dom::Benchmark } else { - for (auto _ : state) + for ([[maybe_unused]] auto _ : state) { auto patchInfo = GenerateHierarchicalDeltaPatch(m_before, m_after); benchmark::DoNotOptimize(patchInfo); diff --git a/Code/Framework/AzCore/Tests/DOM/DomPathBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomPathBenchmarks.cpp index 10c5fa1394..56d1e1f6ab 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomPathBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomPathBenchmarks.cpp @@ -104,7 +104,7 @@ namespace AZ::Dom::Benchmark PathEntry endOfArray; endOfArray.SetEndOfArray(); - for (auto _ : state) + for ([[maybe_unused]] auto _ : state) { benchmark::DoNotOptimize(name == name); benchmark::DoNotOptimize(name == index); diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp index 187ace1cdb..549e8b8bea 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp @@ -289,7 +289,7 @@ namespace UnitTest tag = randomGenerator.GetRandom(); } - for (auto _ : state) + for ([[maybe_unused]] auto _ : state) { // We'll benchmark this two ways: // 1. We clear each time, which means each AddSurfaceWeightIfGreater call will search the whole list then add. @@ -340,7 +340,7 @@ namespace UnitTest comparisonTags.emplace_back(tag ^ 0x01); } - for (auto _ : state) + for ([[maybe_unused]] auto _ : state) { // Test to see if any of our tags match. // All of comparison tags should get compared against all of the added tags.