[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 20 02:52:09 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 059e7be2d1e4397fd40ecaaf913b8a4bfe759779 70a504833bfb540b54bbbe86e8065cf22bdf286b --extensions cpp -- clang/test/Headers/crash-instantiated-in-scope-cxx-modules.cpp clang/lib/AST/DeclTemplate.cpp clang/test/Modules/odr_hash.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index 7dc9afd615..bdd40b01c0 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -354,7 +354,7 @@ void RedeclarableTemplateDecl::loadLazySpecializationsImpl() const {
     // This order matches the order in which namelookup discovers declarations
     // coming from modules.
     for (unsigned I = SpecSize; I != 0; --I)
-      (void)Context.getExternalSource()->GetExternalDecl(Specs[I-1]);
+      (void)Context.getExternalSource()->GetExternalDecl(Specs[I - 1]);
   }
 }
 

``````````

</details>


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


More information about the cfe-commits mailing list