commit f7ad945399ecc1cae4999bb2e0f74ff940b21cdb
parent 4d496b62350f8e278f8503eea6c7d4822f72aca9
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Mon, 17 Nov 2025 21:26:26 +0000
Bug 2000516 - Fix pragma guard for -Wdangling-pointer r=sfink
This flags is only supported by GCC starting with GCC 12, and never was
by clang.
Differential Revision: https://phabricator.services.mozilla.com/D272836
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h
@@ -1159,7 +1159,7 @@ template <typename T>
class MOZ_RAII Rooted : public detail::RootedTraits<T>::StackBase,
public js::RootedOperations<T, Rooted<T>> {
// Intentionally store a pointer into the stack.
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 12)
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 12
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdangling-pointer"
#endif
@@ -1168,7 +1168,7 @@ class MOZ_RAII Rooted : public detail::RootedTraits<T>::StackBase,
this->prev = *this->stack;
*this->stack = this;
}
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 12)
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 12
# pragma GCC diagnostic pop
#endif