From c756585deb57f05415f99f22fbe1d7de31bf5522 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 6 Dec 2022 18:19:59 +0000 Subject: [PATCH] LibWeb: Ignore -Wshadow in TRY_OR_RETURN_OOM() --- Userland/Libraries/LibWeb/WebIDL/DOMException.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.h b/Userland/Libraries/LibWeb/WebIDL/DOMException.h index 878aa1f4603..6b4d5e65a6f 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.h +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -15,7 +16,9 @@ namespace Web::WebIDL { #define TRY_OR_RETURN_OOM(realm, expression) \ ({ \ - auto _temporary_result = (expression); \ + /* Ignore -Wshadow to allow nesting the macro. */ \ + AK_IGNORE_DIAGNOSTIC("-Wshadow", \ + auto _temporary_result = (expression)); \ if (_temporary_result.is_error()) { \ VERIFY(_temporary_result.error().code() == ENOMEM); \ return WebIDL::UnknownError::create(realm, "Out of memory."sv); \