Author: Michael Park
Date: 2025-12-16T10:28:47-08:00
New Revision: 50955d6b89ef903749e8fc98ed1f0085c0af7948

URL: 
https://github.com/llvm/llvm-project/commit/50955d6b89ef903749e8fc98ed1f0085c0af7948
DIFF: 
https://github.com/llvm/llvm-project/commit/50955d6b89ef903749e8fc98ed1f0085c0af7948.diff

LOG: [C++20][Modules][NFC] Some minor non-functional fixes (#172524)

Added: 
    

Modified: 
    clang/lib/Serialization/ASTWriter.cpp
    clang/test/CXX/module/module.reach/p5.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Serialization/ASTWriter.cpp 
b/clang/lib/Serialization/ASTWriter.cpp
index 899fd69c2045e..317ba8679db5d 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4441,9 +4441,9 @@ class ASTDeclContextNameLookupTrait
 
       DeclIDs.push_back(ID);
     };
+    ASTReader *Chain = Writer.getChain();
     for (NamedDecl *D : Decls) {
-      if (ASTReader *Chain = Writer.getChain();
-          Chain && isa<NamespaceDecl>(D) && D->isFromASTFile() &&
+      if (Chain && isa<NamespaceDecl>(D) && D->isFromASTFile() &&
           D == Chain->getKeyDeclaration(D)) {
         // In ASTReader, we stored only the key declaration of a namespace decl
         // for this TU rather than storing all of the key declarations from 
each
@@ -4641,7 +4641,7 @@ uint64_t ASTWriter::WriteSpecializationInfoLookupTable(
   return Offset;
 }
 
-/// Returns ture if all of the lookup result are either external, not emitted 
or
+/// Returns true if all of the lookup result are either external, not emitted 
or
 /// predefined. In such cases, the lookup result is not interesting and we 
don't
 /// need to record the result in the current being written module. Return false
 /// otherwise.

diff  --git a/clang/test/CXX/module/module.reach/p5.cpp 
b/clang/test/CXX/module/module.reach/p5.cpp
index 947fd082553ec..f977049f2e996 100644
--- a/clang/test/CXX/module/module.reach/p5.cpp
+++ b/clang/test/CXX/module/module.reach/p5.cpp
@@ -13,5 +13,5 @@ export using Y = X;
 //--- B.cppm
 export module B;
 import A;
-Y y; // OK, definition of X is reachable
+Y y; // OK, definition of Y is reachable
 X x; // expected-error {{unknown type name 'X'}}


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to