diff options
author | Jonas Toth <jonas.toth@gmail.com> | 2018-10-02 09:38:20 +0000 |
---|---|---|
committer | Jonas Toth <jonas.toth@gmail.com> | 2018-10-02 09:38:20 +0000 |
commit | 46619229acd53c4ed0ae9677bd5faa1dd9723a25 (patch) | |
tree | 8f627970e03570b992b2b38c1334a32645b884cf /clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp | |
parent | 85de54090e5e63aecb356902c42ef157a957e2e2 (diff) | |
download | bcm5719-llvm-46619229acd53c4ed0ae9677bd5faa1dd9723a25.tar.gz bcm5719-llvm-46619229acd53c4ed0ae9677bd5faa1dd9723a25.zip |
[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
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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. } |