aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPharap <2933055+Pharap@users.noreply.github.com>2018-10-26 19:34:34 +0100
committerGitHub <noreply@github.com>2018-10-26 19:34:34 +0100
commit6a717473175cc7d900fe67bc071f7e7c72f01e29 (patch)
tree75ad5ab38c9d49c678e6ed61a0f0d8ee09da672b
parentb410611ffcdcb822d69c828f01dd6216c1ef3348 (diff)
Add noexcept specifier to placement new operator
The standard mandates that placement new should be have a noexcept specifier.
-rw-r--r--cores/arduino/new.cpp2
-rw-r--r--cores/arduino/new.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp
index 86a1fa5..fc30cf8 100644
--- a/cores/arduino/new.cpp
+++ b/cores/arduino/new.cpp
@@ -26,7 +26,7 @@ void *operator new[](size_t size) {
return malloc(size);
}
-void * operator new(size_t size, void * ptr) {
+void * operator new(size_t size, void * ptr) noexcept {
(void)size;
return ptr;
}
diff --git a/cores/arduino/new.h b/cores/arduino/new.h
index 7690911..763f5cc 100644
--- a/cores/arduino/new.h
+++ b/cores/arduino/new.h
@@ -23,7 +23,7 @@
void * operator new(size_t size);
void * operator new[](size_t size);
-void * operator new(size_t size, void * ptr);
+void * operator new(size_t size, void * ptr) noexcept;
void operator delete(void * ptr);
void operator delete[](void * ptr);