summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-07-21 09:40:52 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-07-21 09:40:52 +0000
commitddf36dea135db24d073acd8dbc1251dc798624bb (patch)
tree2eb051e5a123ce1640bb0c518266ed0642f5cd0c /clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp
parentefd14a62a3cd07861e0810ed04bb28b8bae2c25d (diff)
downloadbcm5719-llvm-ddf36dea135db24d073acd8dbc1251dc798624bb.tar.gz
bcm5719-llvm-ddf36dea135db24d073acd8dbc1251dc798624bb.zip
[clang-tidy] Fix a false positive in the make_pair checker if an argument has a explicit template argument.
This required a rather ugly workaround for a problem in ASTMatchers where callee() is only overloaded for Stmt and Decl but not for Expr. llvm-svn: 213509
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp b/clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp
index 4d7b209e6f5..895b8e69bf5 100644
--- a/clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp
+++ b/clang-tools-extra/test/clang-tidy/google-explicit-make-pair.cpp
@@ -21,6 +21,9 @@ void templ(T a, T b) {
// CHECK-FIXES: std::make_pair(1, 2)
}
+template <typename T>
+int t();
+
void test(int i) {
std::make_pair<int, int>(i, i);
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, omit template arguments from make_pair
@@ -45,4 +48,5 @@ M
templ(1U, 2U);
std::make_pair(i, 1); // no-warning
+ std::make_pair(t<int>, 1);
}
OpenPOWER on IntegriCloud