Bug 1431109 - Ignore a second incorrect warning with gcc (-Wuninitialized) r?froydnj
MozReview-Commit-ID: 1QiA78wR9xB
--- a/xpcom/base/StaticPtr.h
+++ b/xpcom/base/StaticPtr.h
@@ -40,17 +40,25 @@ class MOZ_ONLY_USED_TO_AVOID_STATIC_CONS
{
public:
// In debug builds, check that mRawPtr is initialized for us as we expect
// by the compiler. In non-debug builds, don't declare a constructor
// so that the compiler can see that the constructor is trivial.
#ifdef DEBUG
StaticAutoPtr()
{
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+ // False positive with gcc. See bug 1430729
+#endif
MOZ_ASSERT(!mRawPtr);
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
}
#endif
StaticAutoPtr<T>& operator=(T* aRhs)
{
Assign(aRhs);
return *this;
}