[clang] [Sema] Reject unqualified lookup of local nested class name (PR #192678)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 02:29:27 PDT 2026


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 origin/main HEAD --extensions cpp -- clang/test/Sema/unqualified-lookup-local-class.cpp clang/lib/Sema/SemaLookup.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 21c3e479e..c0fffb77e 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -1374,7 +1374,7 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) {
           DeclContext *DC = ND->getDeclContext();
 
           if (DC->isRecord()) {
-          // Only restrict when we're in function or block scope
+            // Only restrict when we're in function or block scope
             if (S->getFnParent() && !S->isClassScope()) {
               continue;
             }

``````````

</details>


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


More information about the cfe-commits mailing list