summaryrefslogtreecommitdiff
path: root/Examples/test-suite/d/default_constructor_runme.1.d
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/d/default_constructor_runme.1.d')
-rw-r--r--Examples/test-suite/d/default_constructor_runme.1.d30
1 files changed, 30 insertions, 0 deletions
diff --git a/Examples/test-suite/d/default_constructor_runme.1.d b/Examples/test-suite/d/default_constructor_runme.1.d
new file mode 100644
index 000000000..3640218ae
--- /dev/null
+++ b/Examples/test-suite/d/default_constructor_runme.1.d
@@ -0,0 +1,30 @@
+module default_constructor_runme;
+
+import default_constructor.FFF;
+import default_constructor.G;
+
+void main() {
+ // Protected destructor test.
+ try {
+ {
+ scope g = new G();
+ }
+ throw new Exception("Protected destructor exception should have been thrown");
+ } catch (Exception e) {
+ if (e.msg != "C++ destructor does not have public access") {
+ throw e;
+ }
+ }
+
+ // Private destructor test.
+ try {
+ {
+ scope f = new FFF();
+ }
+ throw new Exception("Private destructor exception should have been thrown");
+ } catch (Exception e) {
+ if (e.msg != "C++ destructor does not have public access") {
+ throw e;
+ }
+ }
+}