summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
index 789181d88b5..967c086257c 100644
--- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
+++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
@@ -142,11 +142,13 @@ void test_deletion() {
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: initializing non-owner 'int *' with a newly created 'gsl::owner<>'
delete unowned_int1; // BAD, since no owner
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead
+ // CHECK-MESSAGES: [[@LINE-4]]:3: note: variable declared here
int *unowned_int2 = new int[42]; // BAD, since new creates and owner
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: initializing non-owner 'int *' with a newly created 'gsl::owner<>'
delete[] unowned_int2; // BAD since no owner
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead
+ // CHECK-MESSAGES: [[@LINE-4]]:3: note: variable declared here
delete new int(42); // Technically ok, but stupid
delete[] new int[42]; // Technically ok, but stupid
OpenPOWER on IntegriCloud