[clang] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in defaulted comparison operators (PR #102619)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 07:08:57 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 1d77dd50f1bab20d2025d25f79784d5be1520847 f47340974464dccae08980a1f8e78f0982169a58 --extensions cpp -- clang/lib/Sema/SemaDeclCXX.cpp clang/test/SemaCXX/cxx20-default-compare.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 a478bdb46f..08c4cb8e14 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -8415,7 +8415,8 @@ private:
       return {ExprError(), ExprError()};
     CXXCastPath Path = {Base};
     const auto CastToBase = [&](Expr *E) {
-      QualType ToType = S.Context.getQualifiedType(Base->getType(), E->getType().getQualifiers());
+      QualType ToType = S.Context.getQualifiedType(
+          Base->getType(), E->getType().getQualifiers());
       return S.ImpCastExprToType(E, ToType, CK_DerivedToBase, VK_LValue, &Path);
     };
     return {CastToBase(Obj.first.get()), CastToBase(Obj.second.get())};

``````````

</details>


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


More information about the cfe-commits mailing list