From 724a826288d80545adfcefb735858fae14e4c2c3 Mon Sep 17 00:00:00 2001 From: Jonas Toth Date: Thu, 27 Sep 2018 12:17:59 +0000 Subject: [PATCH] [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace Reviewers: aaron.ballman, alexfh, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52185 llvm-svn: 343198 --- .../bugprone-forward-declaration-namespace.cpp | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/clang-tools-extra/test/clang-tidy/bugprone-forward-declaration-namespace.cpp b/clang-tools-extra/test/clang-tidy/bugprone-forward-declaration-namespace.cpp index d938148..e0b2258 100644 --- a/clang-tools-extra/test/clang-tidy/bugprone-forward-declaration-namespace.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-forward-declaration-namespace.cpp @@ -3,19 +3,19 @@ namespace { // This is a declaration in a wrong namespace. class T_A; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace 'na' [bugprone-forward-declaration-namespace] -// CHECK-MESSAGES: note: a declaration of 'T_A' is found here -// CHECK-MESSAGES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)' [bugprone-forward-declaration-namespace] -// CHECK-MESSAGES: note: a definition of 'T_A' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace 'na' [bugprone-forward-declaration-namespace] +// CHECK-NOTES: note: a declaration of 'T_A' is found here +// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)' [bugprone-forward-declaration-namespace] +// CHECK-NOTES: note: a definition of 'T_A' is found here } namespace na { // This is a declaration in a wrong namespace. class T_A; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace '(anonymous)' -// CHECK-MESSAGES: note: a declaration of 'T_A' is found here -// CHECK-MESSAGES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)' -// CHECK-MESSAGES: note: a definition of 'T_A' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace '(anonymous)' +// CHECK-NOTES: note: a declaration of 'T_A' is found here +// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)' +// CHECK-NOTES: note: a definition of 'T_A' is found here } class T_A; @@ -25,8 +25,8 @@ class T_A { }; class NESTED; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: no definition found for 'NESTED', but a definition with the same name 'NESTED' found in another namespace '(anonymous namespace)::nq::(anonymous)' -// CHECK-MESSAGES: note: a definition of 'NESTED' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: no definition found for 'NESTED', but a definition with the same name 'NESTED' found in another namespace '(anonymous namespace)::nq::(anonymous)' +// CHECK-NOTES: note: a definition of 'NESTED' is found here namespace { namespace nq { @@ -38,10 +38,10 @@ class NESTED {}; namespace na { class T_B; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb' -// CHECK-MESSAGES: note: a declaration of 'T_B' is found here -// CHECK-MESSAGES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb' -// CHECK-MESSAGES: note: a definition of 'T_B' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb' +// CHECK-NOTES: note: a declaration of 'T_B' is found here +// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb' +// CHECK-NOTES: note: a definition of 'T_B' is found here } namespace nb { @@ -56,10 +56,10 @@ class T_B { namespace na { class T_B; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb' -// CHECK-MESSAGES: note: a declaration of 'T_B' is found here -// CHECK-MESSAGES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb' -// CHECK-MESSAGES: note: a definition of 'T_B' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb' +// CHECK-NOTES: note: a declaration of 'T_B' is found here +// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb' +// CHECK-NOTES: note: a definition of 'T_B' is found here } // A simple forward declaration. Although it is never used, but no declaration @@ -89,8 +89,8 @@ void f(OUTSIDER_1 *); namespace nb { class OUTSIDER_1; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration 'OUTSIDER_1' is never referenced, but a declaration with the same name found in another namespace 'na' -// CHECK-MESSAGES: note: a declaration of 'OUTSIDER_1' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'OUTSIDER_1' is never referenced, but a declaration with the same name found in another namespace 'na' +// CHECK-NOTES: note: a declaration of 'OUTSIDER_1' is found here } @@ -139,8 +139,8 @@ extern template class T_TEMP_1; namespace nd { class D; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration 'D' is never referenced, but a declaration with the same name found in another namespace 'nd::ne' -// CHECK-MESSAGES: note: a declaration of 'D' is found here +// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'D' is never referenced, but a declaration with the same name found in another namespace 'nd::ne' +// CHECK-NOTES: note: a declaration of 'D' is found here } namespace nd { -- 2.7.4