Bug 1111425 - Silence the warning about operator new returning null in TestNonHeapClass.cpp; r=jrmuizel
clang issues the following warning on this:
'operator new' should not return a null pointer unless it is declared 'throw()' or 'noexcept'
--- a/build/clang-plugin/tests/TestNonHeapClass.cpp
+++ b/build/clang-plugin/tests/TestNonHeapClass.cpp
@@ -1,15 +1,15 @@
#define MOZ_NONHEAP_CLASS __attribute__((annotate("moz_nonheap_class")))
#define MOZ_STACK_CLASS __attribute__((annotate("moz_stack_class")))
#include <stddef.h>
struct MOZ_NONHEAP_CLASS NonHeap {
int i;
- void *operator new(size_t x) { return 0; }
+ void *operator new(size_t x) throw() { return 0; }
void *operator new(size_t blah, char *buffer) { return buffer; }
};
template <class T>
struct MOZ_NONHEAP_CLASS TemplateClass {
T i;
};
--- a/build/clang-plugin/tests/TestStackClass.cpp
+++ b/build/clang-plugin/tests/TestStackClass.cpp
@@ -1,14 +1,14 @@
#define MOZ_STACK_CLASS __attribute__((annotate("moz_stack_class")))
#include <stddef.h>
struct MOZ_STACK_CLASS Stack {
int i;
- void *operator new(size_t x) { return 0; }
+ void *operator new(size_t x) throw() { return 0; }
void *operator new(size_t blah, char *buffer) { return buffer; }
};
template <class T>
struct MOZ_STACK_CLASS TemplateClass {
T i;
};