aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.
LGTM aside from a test coverage request. ================ Comment at: clang-tools-extra/test/clang-tidy/bugprone-spuriously-wake-up-functions.c:26-30 + if (list_c.next == NULL) { + if (0 != cnd_wait(&condition_c, &lock)) { + // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: 'cnd_wait' should be placed inside a while statement [bugprone-spuriously-wake-up-functions] + } + } ---------------- Can you add a test case to demonstrate the behavior when there's not a compound statement involved? And another one for a slightly more complex if predicate? e.g., ``` if (list_c.next == NULL) if (0 != cnd_wait(&condition_c, &lock)) ; if (list_c.next == NULL && 0 != cnd_wait(&condition_c, &lock)) ; ``` Both of these should be flagged similar to the form with the compound statement. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70876/new/ https://reviews.llvm.org/D70876 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits