summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2014-08-25 12:08:19 -0700
committerChih-hung Hsieh <chh@google.com>2014-08-25 21:16:14 +0000
commitae558d6b4bcee740f7e61434982eb5f2c999fb97 (patch)
tree443b26ce7513f9ee430e4f639c5436fd11dbc9a5
parenta4a8c4feb8cf3cebf8aceace70e699e128095b5c (diff)
downloadbionic-ae558d6b4bcee740f7e61434982eb5f2c999fb97.zip
bionic-ae558d6b4bcee740f7e61434982eb5f2c999fb97.tar.gz
bionic-ae558d6b4bcee740f7e61434982eb5f2c999fb97.tar.bz2
Add standard throw() spec to delete operators.
Without these specs, clang will reports mismatch between standard definitions and these declarations/definitions. These specs are ignored when compiled with -fno-exceptions. BUG: 17136236 Change-Id: I386c712a61dc4fc74dfde45f9ec2d3d037f2e9f1
-rw-r--r--libc/bionic/new.cpp8
-rw-r--r--libstdc++/include/new12
2 files changed, 10 insertions, 10 deletions
diff --git a/libc/bionic/new.cpp b/libc/bionic/new.cpp
index fcfd1bd..cd84c2e 100644
--- a/libc/bionic/new.cpp
+++ b/libc/bionic/new.cpp
@@ -38,11 +38,11 @@ void* operator new[](std::size_t size) {
return p;
}
-void operator delete(void* ptr) {
+void operator delete(void* ptr) throw() {
free(ptr);
}
-void operator delete[](void* ptr) {
+void operator delete[](void* ptr) throw() {
free(ptr);
}
@@ -54,10 +54,10 @@ void* operator new[](std::size_t size, const std::nothrow_t&) {
return malloc(size);
}
-void operator delete(void* ptr, const std::nothrow_t&) {
+void operator delete(void* ptr, const std::nothrow_t&) throw() {
free(ptr);
}
-void operator delete[](void* ptr, const std::nothrow_t&) {
+void operator delete[](void* ptr, const std::nothrow_t&) throw() {
free(ptr);
}
diff --git a/libstdc++/include/new b/libstdc++/include/new
index 0253e8b..c5a43de 100644
--- a/libstdc++/include/new
+++ b/libstdc++/include/new
@@ -13,19 +13,19 @@ namespace std {
void* operator new(std::size_t);
void* operator new[](std::size_t);
-void operator delete(void*);
-void operator delete[](void*);
+void operator delete(void*) throw();
+void operator delete[](void*) throw();
void* operator new(std::size_t, const std::nothrow_t&);
void* operator new[](std::size_t, const std::nothrow_t&);
-void operator delete(void*, const std::nothrow_t&);
-void operator delete[](void*, const std::nothrow_t&);
+void operator delete(void*, const std::nothrow_t&) throw();
+void operator delete[](void*, const std::nothrow_t&) throw();
inline void* operator new(std::size_t, void* p) { return p; }
inline void* operator new[](std::size_t, void* p) { return p; }
// these next two are not really required, since exceptions are off
-inline void operator delete(void*, void*) { }
-inline void operator delete[](void*, void*) { }
+inline void operator delete(void*, void*) throw() { }
+inline void operator delete[](void*, void*) throw() { }
} // extern C++