[clang] [MS][clang] Error about ambiguous operator delete[] only when required (PR #135041)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 10 04:05:53 PDT 2025
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 HEAD~1 HEAD --extensions cpp -- clang/lib/Sema/SemaDeclCXX.cpp clang/lib/Sema/SemaExprCXX.cpp clang/test/SemaCXX/gh134265.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 0ee58fbfd..721f61ca4 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -11056,7 +11056,8 @@ bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
// if new[] will be used with the type outside of the library. Otherwise
// when the dtor is not exported then new[]/delete[] in the TU will make
// sure the operator is referenced and its uses diagnosed.
- bool Diagnose = Destructor->hasAttr<DLLExportAttr>() && Destructor->isDefined();
+ bool Diagnose =
+ Destructor->hasAttr<DLLExportAttr>() && Destructor->isDefined();
FunctionDecl *ArrOperatorDelete = FindDeallocationFunctionForDestructor(
Loc, RD, VDeleteName, Diagnose);
Destructor->setOperatorArrayDelete(ArrOperatorDelete);
``````````
</details>
https://github.com/llvm/llvm-project/pull/135041
More information about the cfe-commits
mailing list