// RUN: $(dirname %s)/check_clang_tidy.sh %s google-build-explicit-make-pair %t // REQUIRES: shell namespace std { template struct pair { pair(T1 x, T2 y) {} }; template pair make_pair(T1 x, T2 y) { return pair(x, y); } } template void templ(T a, T b) { std::make_pair(a, b); std::make_pair(1, 2); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, omit template arguments from make_pair // CHECK-FIXES: std::make_pair(1, 2) } template int t(); void test(int i) { std::make_pair(i, i); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, omit template arguments from make_pair // CHECK-FIXES: std::make_pair(i, i) std::make_pair(i, i); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, use pair directly // CHECK-FIXES: std::pair(i, i) std::make_pair(i, i); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, use pair directly // CHECK-FIXES: std::pair(i, i) #define M std::make_pair(i, i); M // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: for C++11-compatibility, use pair directly // Can't fix in macros. // CHECK-FIXES: #define M std::make_pair(i, i); // CHECK-FIXES-NEXT: M templ(i, i); templ(1U, 2U); std::make_pair(i, 1); // no-warning std::make_pair(t, 1); }