[clang] Guard against nullptr (PR #94084)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 17:53:29 PDT 2024


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 bba5ee47e63298d61f6ea441a140144ce370ba92 169e09f2aa403676873a440d8496356cefe69b9e -- clang/lib/AST/QualTypeNames.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/AST/QualTypeNames.cpp b/clang/lib/AST/QualTypeNames.cpp
index 18ac4b1eb5..737092b156 100644
--- a/clang/lib/AST/QualTypeNames.cpp
+++ b/clang/lib/AST/QualTypeNames.cpp
@@ -65,8 +65,7 @@ static bool getFullyQualifiedTemplateName(const ASTContext &Ctx,
   assert(ArgTDecl != nullptr);
   QualifiedTemplateName *QTName = TName.getAsQualifiedTemplateName();
 
-  if (QTName &&
-      !QTName->hasTemplateKeyword() &&
+  if (QTName && !QTName->hasTemplateKeyword() &&
       (NNS = QTName->getQualifier())) {
     NestedNameSpecifier *QNNS = getFullyQualifiedNestedNameSpecifier(
         Ctx, NNS, WithGlobalNsPrefix);

``````````

</details>


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


More information about the cfe-commits mailing list