mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 11:56:07 +00:00

A one-bit signed bit-field can only hold the values 0 and -1; this corrects the diagnostic behavior accordingly. Fixes #53253 Differential Revision: https://reviews.llvm.org/D131255
15 lines
325 B
C++
15 lines
325 B
C++
// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s -fblocks
|
|
|
|
struct S {
|
|
int i : 1;
|
|
int j;
|
|
};
|
|
|
|
void run(void (^)());
|
|
void test() {
|
|
auto [i, j] = S{-1, 42}; // expected-note {{'i' declared here}}
|
|
run(^{
|
|
(void)i; // expected-error {{reference to local binding 'i' declared in enclosing function 'test'}}
|
|
});
|
|
}
|