瀏覽代碼

LibWeb: Ignore -Wshadow in TRY_OR_RETURN_OOM()

Linus Groh 2 年之前
父節點
當前提交
c756585deb
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Userland/Libraries/LibWeb/WebIDL/DOMException.h

+ 4 - 1
Userland/Libraries/LibWeb/WebIDL/DOMException.h

@@ -6,6 +6,7 @@
 
 #pragma once
 
+#include <AK/Diagnostics.h>
 #include <AK/FlyString.h>
 #include <LibJS/Runtime/VM.h>
 #include <LibWeb/Bindings/PlatformObject.h>
@@ -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); \