aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-default-delete.cpp
diff options
context:
space:
mode:
authorSean Hunt <scshunt@csclub.uwaterloo.ca>2011-05-13 01:01:05 +0000
committerSean Hunt <scshunt@csclub.uwaterloo.ca>2011-05-13 01:01:05 +0000
commit7880bc34fd5818d8f1eb827fdce136c1de643ab5 (patch)
tree1a86f159ba77e66d34ddda921c60185184ade15f /test/Parser/cxx-default-delete.cpp
parent18c8339978dabbf1517bfcc4898e8b8c8069283c (diff)
Implement a few basic tests for defaulted and deleted functions.
More comprehensive testing once copy {constructors,assignment operators} can be defaulted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-default-delete.cpp')
-rw-r--r--test/Parser/cxx-default-delete.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Parser/cxx-default-delete.cpp b/test/Parser/cxx-default-delete.cpp
new file mode 100644
index 0000000000..a3d5b2c1d9
--- /dev/null
+++ b/test/Parser/cxx-default-delete.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
+
+int i = delete; // expected-error{{only functions}}
+int j = default; // expected-error{{special member functions}}
+
+int f() = delete, g; // expected-error{{standalone}}
+int o, p() = delete; // expected-error{{standalone}}
+
+struct foo {
+ foo() = default;
+ ~foo() = delete;
+ void bar() = delete;
+};
+
+void baz() = delete;