[clang-tools-extra] [clang-doc] Fix assertions error in Serialize.cpp (PR #141990)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 29 10:14:29 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang-tools-extra/clang-doc/Serialize.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index e9212e4de..3932a939d 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -113,8 +113,9 @@ getFunctionPrototype(const FunctionDecl *FuncDecl) {
       Stream << " " << ParamDecl->getNameAsString();
 
     // Print default argument if it exists
-    if (ParamDecl->hasDefaultArg() && !ParamDecl->hasUninstantiatedDefaultArg()) {
-      if(const Expr *DefaultArg = ParamDecl->getDefaultArg()) {
+    if (ParamDecl->hasDefaultArg() &&
+        !ParamDecl->hasUninstantiatedDefaultArg()) {
+      if (const Expr *DefaultArg = ParamDecl->getDefaultArg()) {
         Stream << " = ";
         DefaultArg->printPretty(Stream, nullptr, Ctx.getPrintingPolicy());
       }

``````````

</details>


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


More information about the cfe-commits mailing list