[clang-tools-extra] [clang-tidy] Fix readability-else-after-return for [[likely]]/[[unlikely]] if (PR #184684)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 13:47:49 PST 2026


================
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++20
+
+void f() {
+  if (true) [[likely]] {
+    return;
+  } else { // comment-0
----------------
vbvictor wrote:

Can we add tests with `[[likely]]` on `else`?

https://github.com/llvm/llvm-project/pull/184684


More information about the cfe-commits mailing list