Fix warn-unsafe-buffer-usage-fixits-pre-increment.cpp for Windows
authorHans Wennborg <hans@chromium.org>
Thu, 13 Apr 2023 08:21:11 +0000 (10:21 +0200)
committerHans Wennborg <hans@chromium.org>
Thu, 13 Apr 2023 08:21:15 +0000 (10:21 +0200)
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

clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-pre-increment.cpp

index 9bad7cb..d3d7e8f 100644 (file)
@@ -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()"
   }