Skip to content

Commit 5ec8f13

Browse files
authored
Improve example in C2135 error reference
1 parent 9577d89 commit 5ec8f13

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

docs/error-messages/compiler-errors-1/compiler-error-c2135.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ The following example generates C2135:
1919

2020
```cpp
2121
// C2135.cpp
22-
struct S {
23-
int i : 1;
24-
};
2522

26-
struct T {
27-
int j;
23+
struct S
24+
{
25+
int bit_field : 1;
26+
int integer;
2827
};
29-
int main() {
30-
&S::i; // C2135 address of a bit field
31-
&T::j; // OK
28+
29+
int main()
30+
{
31+
&S::bit_field; // C2135
32+
&S::integer; // OK
3233
}
3334
```

0 commit comments

Comments
 (0)