[llvm] [NFC][CodingStandard] Add additional example for if-else brace rule (PR #111733)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 13 07:13:51 PDT 2024


================
@@ -1713,6 +1713,14 @@ would help to avoid running into a "dangling else" situation.
     handleOtherDecl(D);
   }
 
+  // Use braces for the `else` block to keep it uniform with the `if` block.
+  if (isa<FunctionDecl>(D)) {
+    verifyFunctionDecl(D);
+    handleFunctionDecl(D);
+  } else {
----------------
jurahul wrote:

Sounds good, I'll amend the example to include an else if and an else.

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


More information about the llvm-commits mailing list