Bug 1111425 - Silence the warning about operator new returning null in TestNonHeapClass.cpp; r=jrmuizel
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 16 Dec 2014 00:38:21 -0500
changeset 219901 b50f7347bb974067aedf766da4f2ce6b55ed63a0
parent 219900 54759604f407869be3a0c119b5160211e3fc412d
child 219902 29ed7a01c8159ded4d93d90c980c80756153712b
push id10419
push usercbook@mozilla.com
push dateTue, 16 Dec 2014 12:45:27 +0000
treeherderfx-team@ec87657146eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1111425
milestone37.0a1
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'
build/clang-plugin/tests/TestNonHeapClass.cpp
build/clang-plugin/tests/TestStackClass.cpp
--- 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;
 };