aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-11 23:23:22 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-11 23:23:22 +0000
commit9d59ecb4d2c2e8efdb214589753826b662246d82 (patch)
tree1bbe77411610065a0e36350c6dbed12653cff374 /test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp
parent6fba85dc6509069ff7735283464bd02da2da6eeb (diff)
Improve diagnostics for malformed delete operator function declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp')
-rw-r--r--test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp b/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp
new file mode 100644
index 0000000000..04af5bc82e
--- /dev/null
+++ b/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}}