[clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload
Reviewers: aaron.ballman, alexfh, hokein
Reviewed By: alexfh
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D52186
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@342459 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/clang-tidy/bugprone-forwarding-reference-overload.cpp b/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
index 3510685..cb842e3 100644
--- a/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
+++ b/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
@@ -20,27 +20,34 @@
class Test1 {
public:
template <typename T> Test1(T &&n);
- // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
+ // CHECK-NOTES: [[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
+ // CHECK-NOTES: 48:3: note: copy constructor declared here
+ // CHECK-NOTES: 49:3: note: copy constructor declared here
+ // CHECK-NOTES: 50:3: note: move constructor declared here
template <typename T> Test1(T &&n, int i = 5, ...);
- // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: 48:3: note: copy constructor declared here
+ // CHECK-NOTES: 49:3: note: copy constructor declared here
+ // CHECK-NOTES: 50:3: note: move constructor declared here
template <typename T, typename U = typename std::enable_if_nice<T>::type>
Test1(T &&n);
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: 48:3: note: copy constructor declared here
+ // CHECK-NOTES: 49:3: note: copy constructor declared here
+ // CHECK-NOTES: 50:3: note: move constructor declared here
template <typename T>
Test1(T &&n, typename foo::enable_if<long>::type i = 5, ...);
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: 48:3: note: copy constructor declared here
+ // CHECK-NOTES: 49:3: note: copy constructor declared here
+ // CHECK-NOTES: 50:3: note: move constructor declared here
Test1(const Test1 &other) {}
- // CHECK-MESSAGES: :[[@LINE-1]]:3: note: copy constructor declared here
-
Test1(Test1 &other) {}
- // CHECK-MESSAGES: :[[@LINE-1]]:3: note: copy constructor declared here
-
Test1(Test1 &&other) {}
- // CHECK-MESSAGES: :[[@LINE-1]]:3: note: move constructor declared here
};
template <typename U> class Test2 {
@@ -96,10 +103,10 @@
class Test4 {
public:
template <typename T> Test4(T &&n);
- // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
Test4(const Test4 &rhs);
- // CHECK-MESSAGES: :[[@LINE-1]]:3: note: copy constructor declared here
+ // CHECK-NOTES: :[[@LINE-1]]:3: note: copy constructor declared here
};
// Nothing can be hidden, the copy constructor is implicitly deleted.
@@ -114,10 +121,10 @@
class Test6 {
public:
template <typename T> Test6(T &&n);
- // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the move constructor
+ // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the move constructor
Test6(Test6 &&rhs);
- // CHECK-MESSAGES: :[[@LINE-1]]:3: note: move constructor declared here
+ // CHECK-NOTES: :[[@LINE-1]]:3: note: move constructor declared here
private:
Test6(const Test6 &rhs);
};
@@ -141,5 +148,5 @@
public:
template <class _Arg, class _Tp = __best_match_t<_Arg, _Types...> >
constexpr variant(_Arg&& __arg) {}
- // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+ // CHECK-NOTES: :[[@LINE-1]]:13: warning: constructor accepting a forwarding reference can hide the copy and move constructors
};