[clang] [analyzer] Fix broken testcase (PR #75216)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 09:09:53 PST 2023


https://github.com/DonatNagyE created https://github.com/llvm/llvm-project/pull/75216

When merging commit c873f77e87a9ebd02f94d6b9d46e84d43e1ceb38 I didn't manually rebase it onto the tip of the main branch, so I didn't notice that the testcase that's added by it needs to be tweaked to account for the effects of commit 2f29ded4f98e8e1fa26725c618a08082a09b405a (which was also merged by me a few days ago).

>From bbea172a9d0eb1bae64e66b7a309b87760011a2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Don=C3=A1t=20Nagy?= <donat.nagy at ericsson.com>
Date: Tue, 12 Dec 2023 18:04:17 +0100
Subject: [PATCH] [analyzer] Fix broken testcase

When merging commit c873f77e87a9ebd02f94d6b9d46e84d43e1ceb38 I didn't
manually rebase it onto the tip of the main branch, so I didn't notice
that the testcase that's added by it needs to be tweaked to account for
the effects of commit 2f29ded4f98e8e1fa26725c618a08082a09b405a (which
was also merged by me a few days ago).
---
 clang/test/Analysis/enum-cast-out-of-range.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/Analysis/enum-cast-out-of-range.cpp b/clang/test/Analysis/enum-cast-out-of-range.cpp
index 82086b73057875..a5ac4f3fd05670 100644
--- a/clang/test/Analysis/enum-cast-out-of-range.cpp
+++ b/clang/test/Analysis/enum-cast-out-of-range.cpp
@@ -226,7 +226,7 @@ enum WidgetKind { A=1, B, C, X=99 }; // expected-note {{enum declared here}}
 void foo() {
   WidgetKind c = static_cast<WidgetKind>(3);  // OK
   WidgetKind x = static_cast<WidgetKind>(99); // OK
-  WidgetKind d = static_cast<WidgetKind>(4);  // expected-warning {{The value provided to the cast expression is not in the valid range of values for 'WidgetKind'}}
+  WidgetKind d = static_cast<WidgetKind>(4);  // expected-warning {{The value '4' provided to the cast expression is not in the valid range of values for 'WidgetKind'}}
 
   ignore_unused(c, x, d);
 }



More information about the cfe-commits mailing list