[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)
via cfe-commits
cfe-commits at lists.llvm.org
Tue May 13 13:41:07 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/test/CodeGenCXX/builtin-get-vtable-pointer.cpp clang/test/SemaCXX/builtin-get-vtable-pointer.cpp clang/lib/CodeGen/CGBuiltin.cpp clang/lib/Sema/SemaChecking.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 39c4fc3fb..b3b33bc72 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -1836,20 +1836,18 @@ static ExprResult GetVTablePointer(Sema &S, CallExpr *Call) {
QualType SubjectType = Subject->getType();
const CXXRecordDecl *SubjectRecord = SubjectType->getPointeeCXXRecordDecl();
if (!SubjectType->isPointerType() || !SubjectRecord) {
- S.Diag(Subject->getBeginLoc(),
- diag::err_get_vtable_pointer_incorrect_type)
+ S.Diag(Subject->getBeginLoc(), diag::err_get_vtable_pointer_incorrect_type)
<< 0 << SubjectType;
return ExprError();
}
if (S.RequireCompleteType(
- Subject->getBeginLoc(), SubjectType->getPointeeType(),
+ Subject->getBeginLoc(), SubjectType->getPointeeType(),
diag::err_get_vtable_pointer_requires_complete_type)) {
return ExprError();
}
if (!SubjectRecord->isPolymorphic()) {
- S.Diag(Subject->getBeginLoc(),
- diag::err_get_vtable_pointer_incorrect_type)
+ S.Diag(Subject->getBeginLoc(), diag::err_get_vtable_pointer_incorrect_type)
<< 1 << SubjectRecord;
return ExprError();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/139790
More information about the cfe-commits
mailing list