summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation
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
commit12308f41e7e26e091950d868d0d2e00a2892fbf0 (patch)
tree9e3df94dbf50fafc9333181c3361b84c1a034b44 /clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation
parentf5303fe492116d077e6e1fabbde6f95ffa173010 (diff)
downloadbcm5719-llvm-12308f41e7e26e091950d868d0d2e00a2892fbf0.tar.gz
bcm5719-llvm-12308f41e7e26e091950d868d0d2e00a2892fbf0.zip
Improve diagnostics for malformed delete operator function declarations.
llvm-svn: 91180
Diffstat (limited to 'clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation')
-rw-r--r--clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp11
1 files changed, 11 insertions, 0 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}}
OpenPOWER on IntegriCloud