xref: /llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/alternative-fixes.cpp (revision abbe9e227ed31e5dde9bb7567bb9f0dd047689c6)
1 // RUN: %check_clang_tidy %s "llvm-namespace-comment,clang-diagnostic-*" %t -- --fix-notes
foo(int a)2 void foo(int a) {
3   if (a = 1) {
4     // CHECK-NOTES: [[@LINE-1]]:9: warning: using the result of an assignment as a condition without parentheses [clang-diagnostic-parentheses]
5     // CHECK-NOTES: [[@LINE-2]]:9: note: place parentheses around the assignment to silence this warning
6     // CHECK-NOTES: [[@LINE-3]]:9: note: use '==' to turn this assignment into an equality comparison
7     // As we have 2 conflicting fixes in notes, don't apply any fix.
8     // CHECK-FIXES: if (a = 1) {
9   }
10 }
11