[clang] [clang-repl] fix vtable symbol duplication error (closes #141039) (PR #185648)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 11 10:22:10 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,h -- clang/test/Interpreter/virtualdef-outside.cpp clang/lib/CodeGen/CGVTables.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenModule.h clang/lib/CodeGen/ItaniumCXXABI.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/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 7fafe137a..14a94a18a 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1579,9 +1579,7 @@ public:
     DeferredVTables.push_back(RD);
   }
 
-  void markVTableDefined(const CXXRecordDecl *RD) {
-    DefinedVTables.insert(RD);
-  }
+  void markVTableDefined(const CXXRecordDecl *RD) { DefinedVTables.insert(RD); }
 
   /// Emit code for a single global function or var decl. Forward declarations
   /// are emitted lazily.

``````````

</details>


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


More information about the cfe-commits mailing list