summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test22635.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/test22635.d')
-rw-r--r--gcc/testsuite/gdc.test/compilable/test22635.d13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/test22635.d b/gcc/testsuite/gdc.test/compilable/test22635.d
new file mode 100644
index 00000000000..c2abc837956
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test22635.d
@@ -0,0 +1,13 @@
+// https://issues.dlang.org/show_bug.cgi?id=22635
+// opCast prevent calling destructor for const this
+
+struct Foo
+{
+ bool opCast(T : bool)() const { assert(0); }
+ ~this() {}
+}
+
+struct Bar
+{
+ const Foo foo;
+}