From 6a717473175cc7d900fe67bc071f7e7c72f01e29 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Fri, 26 Oct 2018 19:34:34 +0100 Subject: Add noexcept specifier to placement new operator The standard mandates that placement new should be have a noexcept specifier. --- cores/arduino/new.cpp | 2 +- cores/arduino/new.h | 2 +- 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); -- cgit v1.2.3-18-g5258