[clang-tools-extra] r342459 - [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload
Jonas Toth via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 18 03:21:33 PDT 2018
Author: jonastoth
Date: Tue Sep 18 03:21:33 2018
New Revision: 342459
URL: http://llvm.org/viewvc/llvm-project?rev=342459&view=rev
Log:
[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
Modified:
clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
Modified: clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp?rev=342459&r1=342458&r2=342459&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp Tue Sep 18 03:21:33 2018
@@ -20,27 +20,34 @@ template <typename T> constexpr bool jus
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 @@ private:
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 @@ public:
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 @@ class variant {
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
};
More information about the cfe-commits
mailing list