[PATCH] D52185: [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 17 12:30:49 PDT 2018
JonasToth created this revision.
JonasToth added reviewers: aaron.ballman, alexfh, hokein.
Herald added subscribers: cfe-commits, xazax.hun.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D52185
Files:
test/clang-tidy/bugprone-forward-declaration-namespace.cpp
Index: test/clang-tidy/bugprone-forward-declaration-namespace.cpp
===================================================================
--- test/clang-tidy/bugprone-forward-declaration-namespace.cpp
+++ 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 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 @@
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 @@
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 @@
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 @@
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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52185.165805.patch
Type: text/x-patch
Size: 5826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180917/12acd555/attachment.bin>
More information about the cfe-commits
mailing list