summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX')
-rw-r--r--clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp11
-rw-r--r--clang/test/CXX/special/class.free/p6.cpp2
2 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp b/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp
new file mode 100644
index 00000000000..04af5bc82ec
--- /dev/null
+++ b/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+struct A {
+ void operator delete(void*);
+};
+
+namespace NS {
+ void operator delete(void *); // expected-error {{'operator delete' cannot be declared inside a namespace}}
+}
+
+static void operator delete(void *); // expected-error {{'operator delete' cannot be declared static in global scope}}
diff --git a/clang/test/CXX/special/class.free/p6.cpp b/clang/test/CXX/special/class.free/p6.cpp
index 8334817ca2b..b082b85d18c 100644
--- a/clang/test/CXX/special/class.free/p6.cpp
+++ b/clang/test/CXX/special/class.free/p6.cpp
@@ -2,7 +2,7 @@
#include <stddef.h>
struct A {
- void operator delete(size_t) {
+ void operator delete(void*) {
(void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
}
void operator delete[](void*) {
OpenPOWER on IntegriCloud