Skip to content

Commit

Permalink
Fix warn-unsafe-buffer-usage-fixits-pre-increment.cpp for Windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zmodem committed Apr 13, 2023
1 parent 674d3d7 commit 39938f2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
}
Expand Down

0 comments on commit 39938f2

Please sign in to comment.