[clang] Qualify non-dependent types of a class template with the class declar… (PR #67566)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 27 08:10:48 PDT 2023


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 9eeb0293e27c0f1b44304fd9681dcd88fd9edc0a 34b4e7939c88627ce433c96cdcc5e54d71ada94d -- clang/lib/AST/QualTypeNames.cpp clang/unittests/Tooling/QualTypeNamesTest.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 32fba2ab887d..6ed5c9c3b2de 100644
--- a/clang/lib/AST/QualTypeNames.cpp
+++ b/clang/lib/AST/QualTypeNames.cpp
@@ -272,22 +272,22 @@ static NestedNameSpecifier *createNestedNameSpecifierForScopeOf(
   const auto *Outer = dyn_cast_or_null<NamedDecl>(DC);
   const auto *OuterNS = dyn_cast_or_null<NamespaceDecl>(DC);
   if (Outer && !(OuterNS && OuterNS->isAnonymousNamespace())) {
-    if (OuterNS) {
-      return createNestedNameSpecifier(Ctx, OuterNS, WithGlobalNsPrefix);
-    } else if (const auto *TD = dyn_cast<TagDecl>(Outer)) {
-      return createNestedNameSpecifier(
-          Ctx, TD, FullyQualified, WithGlobalNsPrefix);
-    } else if (isa<TranslationUnitDecl>(Outer)) {
-      // Context is the TU. Nothing needs to be done.
-      return nullptr;
-    } else {
-      // Decl's context was neither the TU, a namespace, nor a
-      // TagDecl, which means it is a type local to a scope, and not
-      // accessible at the end of the TU.
-      return nullptr;
-    }
+      if (OuterNS) {
+        return createNestedNameSpecifier(Ctx, OuterNS, WithGlobalNsPrefix);
+      } else if (const auto *TD = dyn_cast<TagDecl>(Outer)) {
+        return createNestedNameSpecifier(Ctx, TD, FullyQualified,
+                                         WithGlobalNsPrefix);
+      } else if (isa<TranslationUnitDecl>(Outer)) {
+        // Context is the TU. Nothing needs to be done.
+        return nullptr;
+      } else {
+        // Decl's context was neither the TU, a namespace, nor a
+        // TagDecl, which means it is a type local to a scope, and not
+        // accessible at the end of the TU.
+        return nullptr;
+      }
   } else if (WithGlobalNsPrefix && DC->isTranslationUnit()) {
-    return NestedNameSpecifier::GlobalSpecifier(Ctx);
+      return NestedNameSpecifier::GlobalSpecifier(Ctx);
   }
   return nullptr;
 }

``````````

</details>


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


More information about the cfe-commits mailing list