[clang] 39938f2 - Fix warn-unsafe-buffer-usage-fixits-pre-increment.cpp for Windows
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 13 01:26:08 PDT 2023
Author: Hans Wennborg
Date: 2023-04-13T10:21:15+02:00
New Revision: 39938f2d096ca9ed03ecc17ea169ed3195682f18
URL: https://github.com/llvm/llvm-project/commit/39938f2d096ca9ed03ecc17ea169ed3195682f18
DIFF: https://github.com/llvm/llvm-project/commit/39938f2d096ca9ed03ecc17ea169ed3195682f18.diff
LOG: Fix warn-unsafe-buffer-usage-fixits-pre-increment.cpp for Windows
long is 32-bits on windows, so the test was failing with:
error: cast from pointer to smaller type 'unsigned long' loses
information
see e.g. https://lab.llvm.org/buildbot/#/builders/123/builds/18361
This is a follow-up to D144304
Added:
Modified:
clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-pre-increment.cpp
Removed:
################################################################################
diff --git a/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-pre-increment.cpp b/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-pre-increment.cpp
index 9bad7cb55835..d3d7e8fe821f 100644
--- a/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-pre-increment.cpp
+++ b/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-pre-increment.cpp
@@ -9,8 +9,8 @@ void simple() {
// CHECK-DAG: fix-it:"{{.*}}":{[[@LINE-3]]:24-[[@LINE-3]]:24}:", 10}"
bool b = ++p;
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:12-[[@LINE-1]]:15}:"(p = p.subspan(1)).data()"
- unsigned long n = (unsigned long) ++p;
- // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:37-[[@LINE-1]]:40}:"(p = p.subspan(1)).data()"
+ unsigned long long n = (unsigned long long) ++p;
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:47-[[@LINE-1]]:50}:"(p = p.subspan(1)).data()"
if (++p) {
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:10}:"(p = p.subspan(1)).data()"
}
More information about the cfe-commits
mailing list