[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 19 05:46:24 PST 2024


================
@@ -0,0 +1,108 @@
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fsyntax-only -verify -std=c11 -Wno-unused-value -Wno-unused-but-set-variable -Wbitfield-width -Wbitfield-enum-conversion
+
+enum A {
+  A_a,
+  A_b,
+  A_c,
+  A_d
+};
+
+struct S {
+  enum A a1 : 1; // #1
----------------
ojhunt wrote:

Yeah, I just discovered while working on the C++ version of the test that bookmarks aren't required to be numbers :D

https://github.com/llvm/llvm-project/pull/116785


More information about the cfe-commits mailing list