diff options
Diffstat (limited to 'test/test26.cpp')
-rw-r--r-- | test/test26.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test26.cpp b/test/test26.cpp index baca5d9..929a85a 100644 --- a/test/test26.cpp +++ b/test/test26.cpp @@ -30,6 +30,13 @@ struct Data1 } }; +struct Data2 +{ + virtual ~Data2() + { + } +}; + int k; class Object1 @@ -42,4 +49,39 @@ class Object1 return; } } + + void func2(Data1 *const ptr1) + { + if (!ptr1) + { + if (!ptr1 && k == 1) + return; + } + } + + void func3(Data1 *const ptr1) + { + if (!ptr1) + { + return; + } + delete ptr1; + } + + void func4(Data1 *const ptr1) + { + if (ptr1) + { + return; + } + delete ptr1; + } + + static void func5(Data2 *const ptr1) + { + if (!ptr1) + return; + + delete ptr1; + } }; |