[clang] [clang] When checking for covariant return types, make sure the poiners or references are to *classes* (PR #111856)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 09:54:12 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 55d51dd9dca8220ffaf9260d56dae9f5c34b7120 786d31e2657964e578cd1fdf2006b0fb3b19fab6 --extensions cpp -- clang/lib/Sema/SemaDeclCXX.cpp clang/test/SemaCXX/virtual-override.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 6195b62b8a..75d010dc4e 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -18296,7 +18296,7 @@ bool Sema::CheckOverridingFunctionReturnType(const CXXMethodDecl *New,
                               diag::err_covariant_return_incomplete,
                               New->getDeclName()))
         return true;
-      }
+    }
 
     // Check if the new class derives from the old class.
     if (!IsDerivedFrom(New->getLocation(), NewClassTy, OldClassTy)) {

``````````

</details>


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


More information about the cfe-commits mailing list