[clang] Fix uncounted-obj-arg.cpp for Windows. (PR #81903)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 15 11:02:52 PST 2024
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/81903
None
>From e3a45512e1a10c341b7172ddd3c2c8d42368110b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa <rniwa at webkit.org>
Date: Thu, 15 Feb 2024 10:58:13 -0800
Subject: [PATCH] Fix uncounted-obj-arg.cpp for Windows.
---
clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp b/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
index 156a2480901bf0..338e1b685122bc 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
@@ -107,7 +107,7 @@ class RefCounted {
return 0;
}
void *trivial15() { return static_cast<void*>(this); }
- unsigned long trivial16() { return reinterpret_cast<unsigned long>(this); }
+ unsigned long trivial16() { return *reinterpret_cast<unsigned long*>(this); }
RefCounted& trivial17() const { return const_cast<RefCounted&>(*this); }
RefCounted& trivial18() const { RELEASE_ASSERT(this, "this must be not null"); return const_cast<RefCounted&>(*this); }
void trivial19() const { return; }
More information about the cfe-commits
mailing list