From 46619229acd53c4ed0ae9677bd5faa1dd9723a25 Mon Sep 17 00:00:00 2001 From: Jonas Toth Date: Tue, 2 Oct 2018 09:38:20 +0000 Subject: [clang-tidy] NFC use CHECK-NOTES in tests for cppcoreguidelines-owning-memory Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D52687 llvm-svn: 343564 --- .../clang-tidy/cppcoreguidelines-owning-memory-containers.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp') diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp index 929b33d9987..d39e697c6bd 100644 --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp @@ -37,22 +37,23 @@ int main() { // Rangebased looping in resource vector. for (auto *Element : OwnerStdVector) { Element = new int(42); - // CHECK-MESSAGES: [[@LINE-1]]:5: warning: assigning newly created 'gsl::owner<>' to non-owner 'int *' + // CHECK-NOTES: [[@LINE-1]]:5: warning: assigning newly created 'gsl::owner<>' to non-owner 'int *' } for (auto *Element : OwnerStdVector) { delete Element; - // CHECK-MESSAGES: [[@LINE-1]]:5: warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead - // CHECK-MESSAGES: [[@LINE-3]]:8: note: variable declared here + // CHECK-NOTES: [[@LINE-1]]:5: warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead + // CHECK-NOTES: [[@LINE-3]]:8: note: variable declared here } // Indexbased looping in resource vector. for (int i = 0; i < 100; ++i) { OwnerStdVector[i] = new int(42); - // CHECK-MESSAGES: [[@LINE-1]]:5: warning: assigning newly created 'gsl::owner<>' to non-owner 'int *' + // CHECK-NOTES: [[@LINE-1]]:5: warning: assigning newly created 'gsl::owner<>' to non-owner 'int *' } for (int i = 0; i < 100; ++i) { delete OwnerStdVector[i]; - // CHECK-MESSAGES: [[@LINE-1]]:5: warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead + // CHECK-NOTES: [[@LINE-1]]:5: warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead + // CHECK-NOTES: [[@LINE-21]]:3: note: variable declared here // A note gets emitted here pointing to the return value of the operator[] from the // vector implementation. Maybe this is considered misleading. } -- cgit v1.2.3