diff --git a/test/ctl/optional_test.cc b/test/ctl/optional_test.cc index de75ebe30..49133e7d9 100644 --- a/test/ctl/optional_test.cc +++ b/test/ctl/optional_test.cc @@ -26,6 +26,8 @@ // #include // #define ctl std +static int g = 0; + int main() { @@ -114,6 +116,13 @@ main() return 24; } + { + struct A { int* p = &g; A() {++*p; } }; + ctl::optional x; + if (g != 0) + return 25; + } + CheckForMemoryLeaks(); return 0; }