[clang] [Clang][Sema]: Allow copy constructor side effects (PR #81127)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 8 04:08:48 PST 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 a643ab852a63a14dba86e031247734c5e3d5adb9 3d06ced172a76490c13f892d9165d8cf2702eb87 -- clang/lib/Sema/SemaDecl.cpp clang/test/SemaCXX/warn-unused-variables.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 7f78aef33f..175533b0bd 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2044,7 +2044,8 @@ static bool ShouldDiagnoseUnusedDecl(const LangOptions &LangOpts,
return false;
if (Init) {
- const auto *Construct = dyn_cast<CXXConstructExpr>(Init->IgnoreImpCasts());
+ const auto *Construct =
+ dyn_cast<CXXConstructExpr>(Init->IgnoreImpCasts());
if (Construct && !Construct->isElidable()) {
const CXXConstructorDecl *CD = Construct->getConstructor();
if (!CD->isTrivial() && !RD->hasAttr<WarnUnusedAttr>() &&
``````````
</details>
https://github.com/llvm/llvm-project/pull/81127
More information about the cfe-commits
mailing list