diff --git a/generator/templates/dawn/fuzzers/lpmfuzz/DawnLPMSerializer.cpp b/generator/templates/dawn/fuzzers/lpmfuzz/DawnLPMSerializer.cpp
index 7d0e990..2a53c64 100644
--- a/generator/templates/dawn/fuzzers/lpmfuzz/DawnLPMSerializer.cpp
+++ b/generator/templates/dawn/fuzzers/lpmfuzz/DawnLPMSerializer.cpp
@@ -137,10 +137,8 @@
 
     WireResult {{WGPU}}{{name}}ProtoConvert(fuzzing::{{ name }} proto_record, {{WGPU}}{{ name }}{{ Cmd }} const *record, SerializeBuffer* serializeBuffer, PerObjectType<DawnLPMObjectStore> &objectStores) {
 
-        {{WGPU}}{{ name }}{{ Cmd }} *mutable_record = const_cast<{{WGPU}}{{ name }}{{ Cmd }} *>(record);
-
-        //* Some commands don't set any members.
-        DAWN_UNUSED(mutable_record);
+        //* maybe_unused because some commands don't set any members.
+        [[maybe_unused]] {{WGPU}}{{ name }}{{ Cmd }} *mutable_record = const_cast<{{WGPU}}{{ name }}{{ Cmd }} *>(record);
 
         //* Clear the entire structure to make optional handling simpler.
         memset(mutable_record, 0, sizeof({{WGPU}}{{ name }}{{ Cmd }}));
diff --git a/generator/templates/dawn/wire/WireCmd.cpp b/generator/templates/dawn/wire/WireCmd.cpp
index 9e63d7b..a62906e 100644
--- a/generator/templates/dawn/wire/WireCmd.cpp
+++ b/generator/templates/dawn/wire/WireCmd.cpp
@@ -176,8 +176,7 @@
     {% endif %}
 
     //* Returns the required transfer size for `record` in addition to the transfer structure.
-    DAWN_DECLARE_UNUSED size_t {{Return}}{{name}}GetExtraRequiredSize(const {{Return}}{{name}}{{Cmd}}& record) {
-        DAWN_UNUSED(record);
+    DAWN_DECLARE_UNUSED size_t {{Return}}{{name}}GetExtraRequiredSize([[maybe_unused]] const {{Return}}{{name}}{{Cmd}}& record) {
         size_t result = 0;
 
         //* Gather how much space will be needed for the extension chain.
@@ -242,12 +241,11 @@
     DAWN_DECLARE_UNUSED WireResult {{Return}}{{name}}Serialize(
         const {{Return}}{{name}}{{Cmd}}& record,
         {{Return}}{{name}}Transfer* transfer,
-        SerializeBuffer* buffer
+        [[maybe_unused]] SerializeBuffer* buffer
         {%- if record.may_have_dawn_object -%}
             , const ObjectIdProvider& provider
         {%- endif -%}
     ) {
-        DAWN_UNUSED(buffer);
         //* Handle special transfer members of methods.
         {% if is_cmd %}
             transfer->commandId = {{Return}}WireCmd::{{name}};
@@ -338,13 +336,11 @@
         {{Return}}{{name}}{{Cmd}}* record,
         const volatile {{Return}}{{name}}Transfer* transfer,
         DeserializeBuffer* deserializeBuffer,
-        DeserializeAllocator* allocator
+        [[maybe_unused]] DeserializeAllocator* allocator
         {%- if record.may_have_dawn_object -%}
             , const ObjectIdResolver& resolver
         {%- endif -%}
     ) {
-        DAWN_UNUSED(allocator);
-
         {% if is_cmd %}
             DAWN_ASSERT(transfer->commandId == {{Return}}WireCmd::{{name}});
         {% endif %}
diff --git a/src/dawn/common/Assert.h b/src/dawn/common/Assert.h
index d150132..1182883 100644
--- a/src/dawn/common/Assert.h
+++ b/src/dawn/common/Assert.h
@@ -88,7 +88,7 @@
 #else  // DAWN_COMPILER_IS(*)
 #define DAWN_ASSERT_CALLSITE_HELPER(file, func, line, condition) \
     do {                                                         \
-        DAWN_UNUSED(sizeof(condition));                          \
+        [[maybe_unused]] auto unused = sizeof(condition);        \
     } while (DAWN_ASSERT_LOOP_CONDITION)
 #endif  // DAWN_COMPILER_IS(*)
 
diff --git a/src/dawn/common/Compiler.h b/src/dawn/common/Compiler.h
index b1457ca..3299482 100644
--- a/src/dawn/common/Compiler.h
+++ b/src/dawn/common/Compiler.h
@@ -122,11 +122,6 @@
 #define DAWN_NO_SANITIZE(instrumentation)
 #endif
 
-// DAWN_UNUSED
-//
-// Prevents unused variable/expression warnings on EXPR.
-#define DAWN_UNUSED(EXPR) (void)EXPR
-
 // DAWN_UNUSED_FUNC
 //
 // Prevents unused variable/expression warnings on FUNC.
diff --git a/src/dawn/native/Buffer.cpp b/src/dawn/native/Buffer.cpp
index c24f320..d7702b4 100644
--- a/src/dawn/native/Buffer.cpp
+++ b/src/dawn/native/Buffer.cpp
@@ -689,7 +689,8 @@
     if (GetDevice()->ConsumedError(ValidateUnmap(), "calling %s.Unmap().", this)) {
         return;
     }
-    DAWN_UNUSED(GetDevice()->ConsumedError(Unmap(), "calling %s.Unmap().", this));
+    [[maybe_unused]] bool hadError =
+        GetDevice()->ConsumedError(Unmap(), "calling %s.Unmap().", this);
 }
 
 MaybeError BufferBase::Unmap() {
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index ec3b63a..c014fa0 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -1818,7 +1818,8 @@
 
     UnpackedPtr<TextureDescriptor> unpacked;
     if (!ConsumedError(ValidateAndUnpack(&rawDescriptor), &unpacked)) {
-        DAWN_UNUSED(ConsumedError(ValidateTextureDescriptor(this, unpacked, allowMultiPlanar)));
+        [[maybe_unused]] bool hadError =
+            ConsumedError(ValidateTextureDescriptor(this, unpacked, allowMultiPlanar));
     }
 }
 
diff --git a/src/dawn/native/Limits.cpp b/src/dawn/native/Limits.cpp
index 8c3b078..509e209 100644
--- a/src/dawn/native/Limits.cpp
+++ b/src/dawn/native/Limits.cpp
@@ -157,8 +157,7 @@
 
 template <uint32_t I, uint32_t... Is>
 constexpr uint32_t ReduceSameValue(std::integer_sequence<uint32_t, I, Is...>) {
-    int unused[] = {0, (StaticAssertSame<I, Is>(), 0)...};
-    DAWN_UNUSED(unused);
+    [[maybe_unused]] int unused[] = {0, (StaticAssertSame<I, Is>(), 0)...};
     return I;
 }
 
diff --git a/src/dawn/native/Queue.cpp b/src/dawn/native/Queue.cpp
index 7e061c4..bbeee41 100644
--- a/src/dawn/native/Queue.cpp
+++ b/src/dawn/native/Queue.cpp
@@ -287,9 +287,9 @@
         commands[i]->Destroy();
     }
 
-    DAWN_UNUSED(GetDevice()->ConsumedError(
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(
         std::move(result), "calling %s.Submit(%s)", this,
-        ityp::span<uint32_t, CommandBufferBase* const>(commands, commandCount)));
+        ityp::span<uint32_t, CommandBufferBase* const>(commands, commandCount));
 }
 
 void QueueBase::APIOnSubmittedWorkDone(WGPUQueueWorkDoneCallback callback, void* userdata) {
@@ -411,10 +411,10 @@
                                uint64_t bufferOffset,
                                const void* data,
                                size_t size) {
-    DAWN_UNUSED(
+    [[maybe_unused]] bool hadError =
         GetDevice()->ConsumedError(WriteBuffer(buffer, bufferOffset, data, size),
                                    "calling %s.WriteBuffer(%s, (%d bytes), data, (%d bytes))", this,
-                                   buffer, bufferOffset, size));
+                                   buffer, bufferOffset, size);
 }
 
 MaybeError QueueBase::WriteBuffer(BufferBase* buffer,
@@ -455,10 +455,10 @@
                                 size_t dataSize,
                                 const TextureDataLayout* dataLayout,
                                 const Extent3D* writeSize) {
-    DAWN_UNUSED(GetDevice()->ConsumedError(
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(
         WriteTextureInternal(destination, data, dataSize, *dataLayout, writeSize),
         "calling %s.WriteTexture(%s, (%u bytes), %s, %s)", this, destination, dataSize, dataLayout,
-        writeSize));
+        writeSize);
 }
 
 MaybeError QueueBase::WriteTextureInternal(const ImageCopyTexture* destinationOrig,
@@ -527,16 +527,16 @@
                                          const ImageCopyTexture* destination,
                                          const Extent3D* copySize,
                                          const CopyTextureForBrowserOptions* options) {
-    DAWN_UNUSED(GetDevice()->ConsumedError(
-        CopyTextureForBrowserInternal(source, destination, copySize, options)));
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(
+        CopyTextureForBrowserInternal(source, destination, copySize, options));
 }
 
 void QueueBase::APICopyExternalTextureForBrowser(const ImageCopyExternalTexture* source,
                                                  const ImageCopyTexture* destination,
                                                  const Extent3D* copySize,
                                                  const CopyTextureForBrowserOptions* options) {
-    DAWN_UNUSED(GetDevice()->ConsumedError(
-        CopyExternalTextureForBrowserInternal(source, destination, copySize, options)));
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(
+        CopyExternalTextureForBrowserInternal(source, destination, copySize, options));
 }
 
 MaybeError QueueBase::CopyTextureForBrowserInternal(const ImageCopyTexture* sourceOrig,
diff --git a/src/dawn/native/SharedFence.cpp b/src/dawn/native/SharedFence.cpp
index 3ba1c47..db223c1 100644
--- a/src/dawn/native/SharedFence.cpp
+++ b/src/dawn/native/SharedFence.cpp
@@ -66,7 +66,7 @@
 }
 
 void SharedFenceBase::APIExportInfo(SharedFenceExportInfo* info) const {
-    DAWN_UNUSED(GetDevice()->ConsumedError(ExportInfo(info)));
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(ExportInfo(info));
 }
 
 void SharedFenceBase::DestroyImpl() {}
diff --git a/src/dawn/native/SharedResourceMemory.cpp b/src/dawn/native/SharedResourceMemory.cpp
index ade989b..81eb653 100644
--- a/src/dawn/native/SharedResourceMemory.cpp
+++ b/src/dawn/native/SharedResourceMemory.cpp
@@ -168,16 +168,16 @@
 bool SharedResourceMemory::APIEndAccess(TextureBase* texture,
                                         SharedTextureMemoryEndAccessState* state) {
     bool didEnd = false;
-    DAWN_UNUSED(GetDevice()->ConsumedError(EndAccess(texture, state, &didEnd),
-                                           "calling %s.EndAccess(%s).", this, texture));
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(
+        EndAccess(texture, state, &didEnd), "calling %s.EndAccess(%s).", this, texture);
     return didEnd;
 }
 
 bool SharedResourceMemory::APIEndAccess(BufferBase* buffer,
                                         SharedBufferMemoryEndAccessState* state) {
     bool didEnd = false;
-    DAWN_UNUSED(GetDevice()->ConsumedError(EndAccess(buffer, state, &didEnd),
-                                           "calling %s.EndAccess(%s).", this, buffer));
+    [[maybe_unused]] bool hadError = GetDevice()->ConsumedError(
+        EndAccess(buffer, state, &didEnd), "calling %s.EndAccess(%s).", this, buffer);
     return didEnd;
 }
 
diff --git a/src/dawn/native/d3d/ExternalImageDXGIImpl.cpp b/src/dawn/native/d3d/ExternalImageDXGIImpl.cpp
index ff2aebe..531b331 100644
--- a/src/dawn/native/d3d/ExternalImageDXGIImpl.cpp
+++ b/src/dawn/native/d3d/ExternalImageDXGIImpl.cpp
@@ -133,9 +133,8 @@
     DAWN_ASSERT(mBackendDevice != nullptr);
     if (mBackendDevice->GetValidInternalFormat(mFormat).IsMultiPlanar() &&
         !descriptor->isInitialized) {
-        bool consumed = mBackendDevice->ConsumedError(DAWN_VALIDATION_ERROR(
+        [[maybe_unused]] bool consumed = mBackendDevice->ConsumedError(DAWN_VALIDATION_ERROR(
             "External textures with multiplanar formats must be initialized."));
-        DAWN_UNUSED(consumed);
         return nullptr;
     }
 
diff --git a/src/dawn/native/d3d11/CommandBufferD3D11.cpp b/src/dawn/native/d3d11/CommandBufferD3D11.cpp
index e337ed8..89e8cb7 100644
--- a/src/dawn/native/d3d11/CommandBufferD3D11.cpp
+++ b/src/dawn/native/d3d11/CommandBufferD3D11.cpp
@@ -907,7 +907,7 @@
         }
 
         case Command::PopDebugGroup: {
-            std::ignore = iter->NextCommand<PopDebugGroupCmd>();
+            [[maybe_unused]] auto cmd = iter->NextCommand<PopDebugGroupCmd>();
             commandContext->GetD3DUserDefinedAnnotation()->EndEvent();
             break;
         }
diff --git a/src/dawn/native/d3d12/CommandBufferD3D12.cpp b/src/dawn/native/d3d12/CommandBufferD3D12.cpp
index 90b329c..674ae04 100644
--- a/src/dawn/native/d3d12/CommandBufferD3D12.cpp
+++ b/src/dawn/native/d3d12/CommandBufferD3D12.cpp
@@ -822,10 +822,9 @@
                 Buffer* dstBuffer = ToBackend(copy->destination.Get());
 
                 DAWN_TRY(srcBuffer->EnsureDataInitialized(commandContext));
-                bool cleared;
+                [[maybe_unused]] bool cleared;
                 DAWN_TRY_ASSIGN(cleared, dstBuffer->EnsureDataInitializedAsDestination(
                                              commandContext, copy->destinationOffset, copy->size));
-                DAWN_UNUSED(cleared);
 
                 srcBuffer->TrackUsageAndTransitionNow(commandContext, wgpu::BufferUsage::CopySrc);
                 dstBuffer->TrackUsageAndTransitionNow(commandContext, wgpu::BufferUsage::CopyDst);
@@ -1065,11 +1064,10 @@
                 Buffer* destination = ToBackend(cmd->destination.Get());
                 uint64_t destinationOffset = cmd->destinationOffset;
 
-                bool cleared;
+                [[maybe_unused]] bool cleared;
                 DAWN_TRY_ASSIGN(
                     cleared, destination->EnsureDataInitializedAsDestination(
                                  commandContext, destinationOffset, queryCount * sizeof(uint64_t)));
-                DAWN_UNUSED(cleared);
 
                 // Resolving unavailable queries is undefined behaviour on D3D12, we only can
                 // resolve the available part of sparse queries. In order to resolve the
@@ -1160,10 +1158,10 @@
                 DAWN_ASSERT(uploadHandle.mappedBuffer != nullptr);
                 memcpy(uploadHandle.mappedBuffer, data, size);
 
-                bool cleared;
+                [[maybe_unused]] bool cleared;
                 DAWN_TRY_ASSIGN(cleared, dstBuffer->EnsureDataInitializedAsDestination(
                                              commandContext, offset, size));
-                DAWN_UNUSED(cleared);
+
                 dstBuffer->TrackUsageAndTransitionNow(commandContext, wgpu::BufferUsage::CopyDst);
                 commandList->CopyBufferRegion(
                     dstBuffer->GetD3D12Resource(), offset,
diff --git a/src/dawn/native/d3d12/DeviceD3D12.cpp b/src/dawn/native/d3d12/DeviceD3D12.cpp
index e91368f..2bec840 100644
--- a/src/dawn/native/d3d12/DeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/DeviceD3D12.cpp
@@ -496,10 +496,9 @@
 
     Buffer* dstBuffer = ToBackend(destination);
 
-    bool cleared;
+    [[maybe_unused]] bool cleared;
     DAWN_TRY_ASSIGN(cleared, dstBuffer->EnsureDataInitializedAsDestination(
                                  commandRecordingContext, destinationOffset, size));
-    DAWN_UNUSED(cleared);
 
     CopyFromStagingToBufferHelper(commandRecordingContext, source, sourceOffset, destination,
                                   destinationOffset, size);
diff --git a/src/dawn/native/d3d12/ResidencyManagerD3D12.cpp b/src/dawn/native/d3d12/ResidencyManagerD3D12.cpp
index fc070d4..5a5234e 100644
--- a/src/dawn/native/d3d12/ResidencyManagerD3D12.cpp
+++ b/src/dawn/native/d3d12/ResidencyManagerD3D12.cpp
@@ -195,11 +195,9 @@
         return {};
     }
 
-    uint64_t bytesEvicted;
+    [[maybe_unused]] uint64_t bytesEvicted;
     DAWN_TRY_ASSIGN(bytesEvicted,
                     EnsureCanMakeResident(allocationSize, GetMemorySegmentInfo(memorySegment)));
-    DAWN_UNUSED(bytesEvicted);
-
     return {};
 }
 
@@ -310,9 +308,8 @@
                                                      uint64_t sizeToMakeResident,
                                                      uint64_t numberOfObjectsToMakeResident,
                                                      ID3D12Pageable** allocations) {
-    uint64_t bytesEvicted;
+    [[maybe_unused]] uint64_t bytesEvicted;
     DAWN_TRY_ASSIGN(bytesEvicted, EnsureCanMakeResident(sizeToMakeResident, segment));
-    DAWN_UNUSED(bytesEvicted);
 
     // Note that MakeResident is a synchronous function and can add a significant
     // overhead to command recording. In the future, it may be possible to decrease this
diff --git a/src/dawn/native/metal/BackendMTL.mm b/src/dawn/native/metal/BackendMTL.mm
index c4c8314..68a8b73 100644
--- a/src/dawn/native/metal/BackendMTL.mm
+++ b/src/dawn/native/metal/BackendMTL.mm
@@ -182,8 +182,7 @@
 
 #elif DAWN_PLATFORM_IS(IOS)
 
-MaybeError GetDevicePCIInfo(id<MTLDevice> device, PCIIDs* ids) {
-    DAWN_UNUSED(device);
+MaybeError GetDevicePCIInfo(id<MTLDevice>, PCIIDs* ids) {
     *ids = PCIIDs{0, 0};
     return {};
 }
diff --git a/src/dawn/native/vulkan/DeviceVk.cpp b/src/dawn/native/vulkan/DeviceVk.cpp
index 0df6422..d88ee8f 100644
--- a/src/dawn/native/vulkan/DeviceVk.cpp
+++ b/src/dawn/native/vulkan/DeviceVk.cpp
@@ -748,9 +748,8 @@
     }
     if (GetValidInternalFormat(textureDescriptor->format).IsMultiPlanar() &&
         !descriptor->isInitialized) {
-        bool consumed = ConsumedError(DAWN_VALIDATION_ERROR(
+        [[maybe_unused]] bool consumed = ConsumedError(DAWN_VALIDATION_ERROR(
             "External textures with multiplanar formats must be initialized."));
-        DAWN_UNUSED(consumed);
         return nullptr;
     }
 
diff --git a/src/dawn/native/vulkan/QueueVk.cpp b/src/dawn/native/vulkan/QueueVk.cpp
index 820b93d..1f32505 100644
--- a/src/dawn/native/vulkan/QueueVk.cpp
+++ b/src/dawn/native/vulkan/QueueVk.cpp
@@ -188,11 +188,11 @@
     Device* device = ToBackend(GetDevice());
     VkDevice vkDevice = device->GetVkDevice();
 
-    VkResult waitIdleResult = VkResult::WrapUnsafe(device->fn.QueueWaitIdle(mQueue));
     // Ignore the result of QueueWaitIdle: it can return OOM which we can't really do anything
     // about, Device lost, which means workloads running on the GPU are no longer accessible
     // (so they are as good as waited on) or success.
-    DAWN_UNUSED(waitIdleResult);
+    [[maybe_unused]] VkResult waitIdleResult =
+        VkResult::WrapUnsafe(device->fn.QueueWaitIdle(mQueue));
 
     // Make sure all fences are complete by explicitly waiting on them all
     mFencesInFlight.Use([&](auto fencesInFlight) {
diff --git a/src/dawn/native/vulkan/SwapChainVk.cpp b/src/dawn/native/vulkan/SwapChainVk.cpp
index b33764e..05191a5 100644
--- a/src/dawn/native/vulkan/SwapChainVk.cpp
+++ b/src/dawn/native/vulkan/SwapChainVk.cpp
@@ -53,14 +53,12 @@
 
 ResultOrError<VkSurfaceKHR> CreateVulkanSurface(const PhysicalDevice* physicalDevice,
                                                 const Surface* surface) {
-    const VulkanGlobalInfo& info = physicalDevice->GetVulkanInstance()->GetGlobalInfo();
-    const VulkanFunctions& fn = physicalDevice->GetVulkanInstance()->GetFunctions();
-    VkInstance instance = physicalDevice->GetVulkanInstance()->GetVkInstance();
-
     // May not be used in the platform-specific switches below.
-    DAWN_UNUSED(info);
-    DAWN_UNUSED(fn);
-    DAWN_UNUSED(instance);
+    [[maybe_unused]] const VulkanGlobalInfo& info =
+        physicalDevice->GetVulkanInstance()->GetGlobalInfo();
+    [[maybe_unused]] const VulkanFunctions& fn =
+        physicalDevice->GetVulkanInstance()->GetFunctions();
+    [[maybe_unused]] VkInstance instance = physicalDevice->GetVulkanInstance()->GetVkInstance();
 
     switch (surface->GetType()) {
 #if defined(DAWN_ENABLE_BACKEND_METAL)
diff --git a/src/dawn/native/vulkan/TextureVk.cpp b/src/dawn/native/vulkan/TextureVk.cpp
index 3b331f2..6700baf 100644
--- a/src/dawn/native/vulkan/TextureVk.cpp
+++ b/src/dawn/native/vulkan/TextureVk.cpp
@@ -952,7 +952,7 @@
     VkFormat format = VulkanImageFormat(device, GetFormat().format);
     VkImageUsageFlags usage = VulkanImageUsage(GetInternalUsage(), GetFormat());
 
-    bool supportsDisjoint;
+    [[maybe_unused]] bool supportsDisjoint;
     DAWN_INVALID_IF(
         !externalMemoryService->SupportsCreateImage(descriptor, format, usage, &supportsDisjoint),
         "Creating an image from external memory is not supported.");
@@ -960,7 +960,6 @@
     // the combined aspect without checking for disjoint support.
     // TODO(dawn:1548): Support multi-planar images with the DISJOINT feature and potentially allow
     // acting on planes individually? Always using Color is valid even for disjoint images.
-    DAWN_UNUSED(supportsDisjoint);
     DAWN_ASSERT(!GetFormat().IsMultiPlanar() || mCombinedAspect == Aspect::Color);
 
     mExternalState = ExternalState::PendingAcquire;
diff --git a/src/dawn/tests/perf_tests/DrawCallPerf.cpp b/src/dawn/tests/perf_tests/DrawCallPerf.cpp
index c06ea30..f5f0a3c 100644
--- a/src/dawn/tests/perf_tests/DrawCallPerf.cpp
+++ b/src/dawn/tests/perf_tests/DrawCallPerf.cpp
@@ -128,11 +128,10 @@
     DrawCallParamTuple paramTuple{Pipeline::Static, VertexBuffer::NoChange, BindGroup::NoChange,
                                   UniformData::Static, RenderBundle::No};
 
-    unsigned int unused[] = {
+    [[maybe_unused]] unsigned int unused[] = {
         0,  // Avoid making a 0-sized array.
         AssignParam(std::get<Ts>(paramTuple), args)...,
     };
-    DAWN_UNUSED(unused);
 
     return DrawCallParam{
         std::get<Pipeline>(paramTuple),     std::get<VertexBuffer>(paramTuple),
diff --git a/src/dawn/tests/unittests/BitSetIteratorTests.cpp b/src/dawn/tests/unittests/BitSetIteratorTests.cpp
index 0bccb75..615212b 100644
--- a/src/dawn/tests/unittests/BitSetIteratorTests.cpp
+++ b/src/dawn/tests/unittests/BitSetIteratorTests.cpp
@@ -68,8 +68,7 @@
     // We don't use the FAIL gtest macro here since it returns immediately,
     // causing an unreachable code warning in MSVC
     bool sawBit = false;
-    for (uint32_t bit : IterateBitSet(mStateBits)) {
-        DAWN_UNUSED(bit);
+    for ([[maybe_unused]] uint32_t bit : IterateBitSet(mStateBits)) {
         sawBit = true;
     }
     EXPECT_FALSE(sawBit);
@@ -136,8 +135,7 @@
     // We don't use the FAIL gtest macro here since it returns immediately,
     // causing an unreachable code warning in MSVC
     bool sawBit = false;
-    for (TestEnum bit : IterateBitSet(mStateBits)) {
-        DAWN_UNUSED(bit);
+    for ([[maybe_unused]] TestEnum bit : IterateBitSet(mStateBits)) {
         sawBit = true;
     }
     EXPECT_FALSE(sawBit);
@@ -202,8 +200,7 @@
     // We don't use the FAIL gtest macro here since it returns immediately,
     // causing an unreachable code warning in MSVC
     bool sawBit = false;
-    for (IntegerT bit : IterateBitSet(mStateBits)) {
-        DAWN_UNUSED(bit);
+    for ([[maybe_unused]] IntegerT bit : IterateBitSet(mStateBits)) {
         sawBit = true;
     }
     EXPECT_FALSE(sawBit);
diff --git a/src/dawn/tests/unittests/EnumMaskIteratorTests.cpp b/src/dawn/tests/unittests/EnumMaskIteratorTests.cpp
index 9430251..04f81e5 100644
--- a/src/dawn/tests/unittests/EnumMaskIteratorTests.cpp
+++ b/src/dawn/tests/unittests/EnumMaskIteratorTests.cpp
@@ -54,9 +54,12 @@
 static_assert(EnumBitmaskSize<TestAspect>::value == 3);
 
 TEST(EnumMaskIteratorTests, None) {
-    for (TestAspect aspect : IterateEnumMask(static_cast<TestAspect>(0))) {
+    for ([[maybe_unused]] TestAspect aspect : IterateEnumMask(static_cast<TestAspect>(0))) {
+        // Silence a -Wunreachable-code-loop-increment
+        if ((0)) {
+            continue;
+        }
         FAIL();
-        DAWN_UNUSED(aspect);
     }
 }
 
diff --git a/src/dawn/tests/unittests/EnumeratorTests.cpp b/src/dawn/tests/unittests/EnumeratorTests.cpp
index c20db30..d7d8b85 100644
--- a/src/dawn/tests/unittests/EnumeratorTests.cpp
+++ b/src/dawn/tests/unittests/EnumeratorTests.cpp
@@ -52,9 +52,7 @@
 
     template <typename Thing>
     void CheckEmpty(Thing thingToEnumerate) {
-        for (auto [index, value] : Enumerate(thingToEnumerate)) {
-            DAWN_UNUSED(index);
-            DAWN_UNUSED(value);
+        for ([[maybe_unused]] auto [index, value] : Enumerate(thingToEnumerate)) {
             FAIL();
         }
     }
diff --git a/src/dawn/tests/unittests/ErrorTests.cpp b/src/dawn/tests/unittests/ErrorTests.cpp
index f476143..9b25c9e 100644
--- a/src/dawn/tests/unittests/ErrorTests.cpp
+++ b/src/dawn/tests/unittests/ErrorTests.cpp
@@ -180,9 +180,8 @@
     };
 
     auto Try = [ReturnError]() -> ResultOrError<int*> {
-        int* result = nullptr;
+        [[maybe_unused]] int* result = nullptr;
         DAWN_TRY_ASSIGN(result, ReturnError());
-        DAWN_UNUSED(result);
 
         // DAWN_TRY should return before this point
         EXPECT_FALSE(true);
@@ -236,9 +235,8 @@
     };
 
     auto Try = [ReturnError]() -> MaybeError {
-        int* result = nullptr;
+        [[maybe_unused]] int* result = nullptr;
         DAWN_TRY_ASSIGN(result, ReturnError());
-        DAWN_UNUSED(result);
 
         return {};
     };
@@ -258,9 +256,8 @@
     };
 
     auto Try = [ReturnError]() -> MaybeError {
-        int result = 0;
+        [[maybe_unused]] int result = 0;
         DAWN_TRY_ASSIGN(result, ReturnError());
-        DAWN_UNUSED(result);
 
         return {};
     };
@@ -307,9 +304,8 @@
     bool tryCleanup = false;
 
     auto Try = [ReturnError, &tryCleanup]() -> ResultOrError<int*> {
-        int* result = nullptr;
+        [[maybe_unused]] int* result = nullptr;
         DAWN_TRY_ASSIGN_WITH_CLEANUP(result, ReturnError(), { tryCleanup = true; });
-        DAWN_UNUSED(result);
 
         // DAWN_TRY_ASSIGN_WITH_CLEANUP should return before this point
         EXPECT_FALSE(true);
@@ -331,9 +327,8 @@
     };
 
     auto Try = [ReturnError]() -> bool {
-        int* result = nullptr;
+        [[maybe_unused]] int* result = nullptr;
         DAWN_TRY_ASSIGN_WITH_CLEANUP(result, ReturnError(), {}, true);
-        DAWN_UNUSED(result);
 
         // DAWN_TRY_ASSIGN_WITH_CLEANUP should return before this point
         EXPECT_FALSE(true);
diff --git a/src/dawn/tests/unittests/RangeTests.cpp b/src/dawn/tests/unittests/RangeTests.cpp
index 0f0dd9d..5a34bfe 100644
--- a/src/dawn/tests/unittests/RangeTests.cpp
+++ b/src/dawn/tests/unittests/RangeTests.cpp
@@ -35,20 +35,18 @@
 
 // Test that iterating an empty range doesn't iterate at all.
 TEST(RangeTests, Empty) {
-    for (auto i : Range(0)) {
+    for ([[maybe_unused]] auto i : Range(0)) {
         // Silence a -Wunreachable-code-loop-increment
         if ((0)) {
             continue;
         }
-        DAWN_UNUSED(i);
         FAIL();
     }
-    for (auto i : Range(0, 0)) {
+    for ([[maybe_unused]] auto i : Range(0, 0)) {
         // Silence a -Wunreachable-code-loop-increment
         if ((0)) {
             continue;
         }
-        DAWN_UNUSED(i);
         FAIL();
     }
 }
diff --git a/src/dawn/tests/unittests/RefBaseTests.cpp b/src/dawn/tests/unittests/RefBaseTests.cpp
index 94b3a16..ee70d2f 100644
--- a/src/dawn/tests/unittests/RefBaseTests.cpp
+++ b/src/dawn/tests/unittests/RefBaseTests.cpp
@@ -133,7 +133,7 @@
     Ref ref(tracker);
 
     events.clear();
-    { DAWN_UNUSED(ref.Detach()); }
+    { [[maybe_unused]] auto ptr = ref.Detach(); }
     EXPECT_THAT(events, testing::ElementsAre(Event{Action::kAssign, 1, 0}  // nullify ref
                                              ));
 }
diff --git a/src/dawn/tests/unittests/SerialMapTests.cpp b/src/dawn/tests/unittests/SerialMapTests.cpp
index 8776ee6..68e956a 100644
--- a/src/dawn/tests/unittests/SerialMapTests.cpp
+++ b/src/dawn/tests/unittests/SerialMapTests.cpp
@@ -45,8 +45,7 @@
     ASSERT_TRUE(map.Empty());
 
     // Iterating on empty map 1) works 2) doesn't produce any values
-    for (int value : map.IterateAll()) {
-        DAWN_UNUSED(value);
+    for ([[maybe_unused]] int value : map.IterateAll()) {
         ASSERT_TRUE(false);
     }
 
@@ -68,8 +67,7 @@
     map.Clear();
     ASSERT_TRUE(map.Empty());
 
-    for (int value : map.IterateAll()) {
-        DAWN_UNUSED(value);
+    for ([[maybe_unused]] int value : map.IterateAll()) {
         ASSERT_TRUE(false);
     }
 }
diff --git a/src/dawn/tests/unittests/SerialQueueTests.cpp b/src/dawn/tests/unittests/SerialQueueTests.cpp
index 5fd5b7a..f785889 100644
--- a/src/dawn/tests/unittests/SerialQueueTests.cpp
+++ b/src/dawn/tests/unittests/SerialQueueTests.cpp
@@ -45,8 +45,7 @@
     ASSERT_TRUE(queue.Empty());
 
     // Iterating on empty queue 1) works 2) doesn't produce any values
-    for (int value : queue.IterateAll()) {
-        DAWN_UNUSED(value);
+    for ([[maybe_unused]] int value : queue.IterateAll()) {
         ASSERT_TRUE(false);
     }
 
@@ -68,8 +67,7 @@
     queue.Clear();
     ASSERT_TRUE(queue.Empty());
 
-    for (int value : queue.IterateAll()) {
-        DAWN_UNUSED(value);
+    for ([[maybe_unused]] int value : queue.IterateAll()) {
         ASSERT_TRUE(false);
     }
 }
diff --git a/src/dawn/tests/unittests/UnicodeTests.cpp b/src/dawn/tests/unittests/UnicodeTests.cpp
index 3c53dc5..dcfe73c 100644
--- a/src/dawn/tests/unittests/UnicodeTests.cpp
+++ b/src/dawn/tests/unittests/UnicodeTests.cpp
@@ -84,7 +84,7 @@
         native::ResultOrError<uint64_t> resultOrError =
             native::CountUTF16CodeUnitsFromUTF8String(std::string_view(testCase));
         ASSERT_TRUE(resultOrError.IsError());
-        std::ignore = resultOrError.AcquireError();
+        [[maybe_unused]] auto err = resultOrError.AcquireError();
     }
 }
 
diff --git a/src/dawn/wire/client/Buffer.cpp b/src/dawn/wire/client/Buffer.cpp
index af40829..1caaf47 100644
--- a/src/dawn/wire/client/Buffer.cpp
+++ b/src/dawn/wire/client/Buffer.cpp
@@ -356,8 +356,8 @@
     }
 
     if (mPendingMapRequest) {
-        DAWN_UNUSED(GetEventManager().SetFutureReady<MapAsyncEvent>(
-            futureIDInternal, WGPUBufferMapAsyncStatus_MappingAlreadyPending));
+        [[maybe_unused]] auto id = GetEventManager().SetFutureReady<MapAsyncEvent>(
+            futureIDInternal, WGPUBufferMapAsyncStatus_MappingAlreadyPending);
         return {futureIDInternal};
     }
 
