[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 22:32:10 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 dee058f9e3ae95b8f4b95034b65c3d7408060c8e 2ce2ed721f1ee985aa6163331bcb1f2f666a3b62 --extensions cpp -- clang/lib/Sema/SemaModule.cpp clang/test/CXX/module/module.import/p2.cpp clang/test/Modules/cxx20-10-3-ex1.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index 5748906748..9a80adbde6 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -652,8 +652,10 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
 
   assert((!Mod->isModulePartitionImplementation() || getCurrentModule()) &&
          "We can only import a partition unit in a named module.");
-  if (Mod->isModulePartitionImplementation() && getCurrentModule()->isModuleInterfaceUnit())
-    Diag(ImportLoc, diag::warn_import_implementation_partition_unit_in_interface_unit);
+  if (Mod->isModulePartitionImplementation() &&
+      getCurrentModule()->isModuleInterfaceUnit())
+    Diag(ImportLoc,
+         diag::warn_import_implementation_partition_unit_in_interface_unit);
 
   checkModuleImportContext(*this, Mod, ImportLoc, CurContext);
 

``````````

</details>


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


More information about the cfe-commits mailing list