Index: test/clang-tidy/check_clang_tidy_fix.sh =================================================================== --- test/clang-tidy/check_clang_tidy_fix.sh +++ test/clang-tidy/check_clang_tidy_fix.sh @@ -10,8 +10,14 @@ # We need to keep the comments to preserve line numbers while avoiding empty # lines which could potentially trigger formatting-related checks. sed 's#// *[A-Z-]\+:.*#//#' ${INPUT_FILE} > ${TEMPORARY_FILE} -clang-tidy ${TEMPORARY_FILE} -fix --checks="-*,${CHECK_TO_RUN}" -- --std=c++11 > ${TEMPORARY_FILE}.msg 2>&1 -FileCheck -input-file=${TEMPORARY_FILE} ${INPUT_FILE} -check-prefix=CHECK-FIXES -strict-whitespace || exit $? + +clang-tidy ${TEMPORARY_FILE} -fix --checks="-*,${CHECK_TO_RUN}" -- --std=c++11 \ + > ${TEMPORARY_FILE}.msg 2>&1 + +FileCheck -input-file=${TEMPORARY_FILE} ${INPUT_FILE} \ + -check-prefix=CHECK-FIXES -strict-whitespace || exit $? + if grep -q CHECK-MESSAGES ${INPUT_FILE}; then - FileCheck -input-file=${TEMPORARY_FILE}.msg ${INPUT_FILE} -check-prefix=CHECK-MESSAGES || exit $? + FileCheck -input-file=${TEMPORARY_FILE}.msg ${INPUT_FILE} \ + -check-prefix=CHECK-MESSAGES -implicit-check-not="warning:" || exit $? fi Index: test/clang-tidy/llvm-twine-local.cpp =================================================================== --- test/clang-tidy/llvm-twine-local.cpp +++ test/clang-tidy/llvm-twine-local.cpp @@ -15,19 +15,19 @@ void foo(const Twine &x); static Twine Moo = Twine("bark") + "bah"; -// CHECK-MESSAGES: twine variables are prone to use-after-free bugs +// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes // CHECK-FIXES: static std::string Moo = (Twine("bark") + "bah").str(); int main() { const Twine t = Twine("a") + "b" + Twine(42); -// CHECK-MESSAGES: twine variables are prone to use-after-free bugs +// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes // CHECK-FIXES: std::string t = (Twine("a") + "b" + Twine(42)).str(); foo(Twine("a") + "b"); Twine Prefix = false ? "__INT_FAST" : "__UINT_FAST"; -// CHECK-MESSAGES: twine variables are prone to use-after-free bugs +// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes // CHECK-FIXES: const char * Prefix = false ? "__INT_FAST" : "__UINT_FAST"; } Index: test/clang-tidy/redundant-smartptr-get.cpp =================================================================== --- test/clang-tidy/redundant-smartptr-get.cpp +++ test/clang-tidy/redundant-smartptr-get.cpp @@ -1,8 +1,6 @@ // RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-redundant-smartptr-get %t // REQUIRES: shell -// CHECK-MESSAGES-NOT: warning - namespace std { template @@ -103,8 +101,6 @@ // CHECK-FIXES: bb = nullptr != *ss; } -// CHECK-MESSAGES-NOT: warning: - void Negative() { struct NegPtr { int* get(); Index: test/clang-tidy/use-override.cpp =================================================================== --- test/clang-tidy/use-override.cpp +++ test/clang-tidy/use-override.cpp @@ -1,8 +1,6 @@ // RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-use-override %t // REQUIRES: shell -// CHECK-MESSAGES-NOT: warning: - #define ABSTRACT = 0 #define OVERRIDE override @@ -198,6 +196,7 @@ template struct DerivedFromTemplate : public TemplateBase { virtual void f(T t); + // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using // CHECK-FIXES: {{^ void f\(T t\) override;}} }; void f() { DerivedFromTemplate().f(2); } @@ -220,5 +219,3 @@ }; template <> void MembersOfSpecializations<3>::a() {} void f() { MembersOfSpecializations<3>().a(); }; - -// CHECK-MESSAGES-NOT: warning: