Bug 1711821 - Word around GCC bug with nodiscard forwarded nullptr r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D115458
This commit is contained in:
Mike Hommey 2021-05-25 20:12:07 +00:00
parent 28e098745c
commit 87c8445c5a

View File

@ -1385,7 +1385,9 @@ void GetInterfaceImpl(JSContext* aCx, nsIInterfaceRequestor* aRequestor,
}
bool ThrowingConstructor(JSContext* cx, unsigned argc, JS::Value* vp) {
return ThrowErrorMessage<MSG_ILLEGAL_CONSTRUCTOR>(cx, nullptr);
// Cast nullptr to void* to work around
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100666
return ThrowErrorMessage<MSG_ILLEGAL_CONSTRUCTOR>(cx, (void*)nullptr);
}
bool ThrowConstructorWithoutNew(JSContext* cx, const char* name) {