Skip to content

Commit c2cfd75

Browse files
committed
[cxx-interop] Add test for explicit operator bool
rdar://137879510
1 parent 04d055a commit c2cfd75

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/Interop/Cxx/stdlib/overlay/Inputs/convertible-to-bool.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ struct DualOverloadBoolBox {
1616
operator bool() const { return value; }
1717
operator bool() { return value; }
1818
};
19+
20+
struct ExplicitBoolBox {
21+
private:
22+
bool value;
23+
24+
public:
25+
explicit operator bool() const { return value; }
26+
};

test/Interop/Cxx/stdlib/overlay/convertible-to-bool-module-interface.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010

1111
// CHECK: struct DualOverloadBoolBox : CxxConvertibleToBool {
1212
// CHECK: }
13+
14+
// CHECK: struct ExplicitBoolBox : CxxConvertibleToBool {
15+
// CHECK: }

0 commit comments

Comments
 (0)