[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 12 09:03:37 PDT 2023
================
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -Wconversion -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wbitfield-conversion -fsyntax-only -verify %s
+
+typedef struct _xx {
+ int bf:9; // expected-note{{declared here}}
+ // expected-note at -1{{declared here}}
+ // expected-note at -2{{declared here}}
+ // expected-note at -3{{declared here}}
----------------
AaronBallman wrote:
```suggestion
int bf:9; // expected-note 4{{declared here}}
```
NFC, but is shorter
https://github.com/llvm/llvm-project/pull/68276
More information about the cfe-commits
mailing list