summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/test/useuniqueptr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/test/useuniqueptr.cxx')
-rw-r--r--compilerplugins/clang/test/useuniqueptr.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/useuniqueptr.cxx b/compilerplugins/clang/test/useuniqueptr.cxx
index a68cea3201d0..8ef71175bb99 100644
--- a/compilerplugins/clang/test/useuniqueptr.cxx
+++ b/compilerplugins/clang/test/useuniqueptr.cxx
@@ -162,4 +162,14 @@ class Foo13 {
DELETEZ(m_pbar2); // expected-error {{unconditional call to delete on a member, should be using std::unique_ptr [loplugin:useuniqueptr]}}
}
};
+// check for unconditional inner compound statements
+class Foo14 {
+ int * m_pbar1; // expected-note {{member is here [loplugin:useuniqueptr]}}
+ ~Foo14()
+ {
+ {
+ delete m_pbar1; // expected-error {{unconditional call to delete on a member, should be using std::unique_ptr [loplugin:useuniqueptr]}}
+ }
+ }
+};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */