@@ -11,12 +11,12 @@ struct P {
11
11
};
12
12
13
13
void f () {
14
- int i = __builtin_offsetof (P, fieldThatPointsToANonPODType.m ); // expected-warning{{offset of on non-POD type 'P'}}
14
+ int i = __builtin_offsetof (P, fieldThatPointsToANonPODType.m ); // expected-warning{{'offsetof' on non-POD type 'P'}}
15
15
}
16
16
17
17
struct Base { int x; };
18
18
struct Derived : Base { int y; };
19
- int o = __builtin_offsetof(Derived, x); // expected-warning{{offset of on non-POD type}}
19
+ int o = __builtin_offsetof(Derived, x); // expected-warning{{'offsetof' on non-POD type}}
20
20
21
21
const int o2 = sizeof (__builtin_offsetof(Derived, x));
22
22
@@ -51,9 +51,9 @@ struct Derived2 : public Base1, public Base2 {
51
51
int z;
52
52
};
53
53
54
- int derived1[__builtin_offsetof(Derived2, x) == 0 ? 1 : -1 ]; // expected-warning{{offset of on non-POD type 'Derived2'}}
55
- int derived2[__builtin_offsetof(Derived2, y) == 4 ? 1 : -1 ]; // expected-warning{{offset of on non-POD type 'Derived2'}}
56
- int derived3[__builtin_offsetof(Derived2, z) == 8 ? 1 : -1 ]; // expected-warning{{offset of on non-POD type 'Derived2'}}
54
+ int derived1[__builtin_offsetof(Derived2, x) == 0 ? 1 : -1 ]; // expected-warning{{'offsetof' on non-POD type 'Derived2'}}
55
+ int derived2[__builtin_offsetof(Derived2, y) == 4 ? 1 : -1 ]; // expected-warning{{'offsetof' on non-POD type 'Derived2'}}
56
+ int derived3[__builtin_offsetof(Derived2, z) == 8 ? 1 : -1 ]; // expected-warning{{'offsetof' on non-POD type 'Derived2'}}
57
57
58
58
// offsetof referring to anonymous struct in base.
59
59
// PR7769
@@ -66,7 +66,7 @@ struct foo {
66
66
struct bar : public foo {
67
67
};
68
68
69
- int anonstruct[__builtin_offsetof(bar, x) == 0 ? 1 : -1 ]; // expected-warning{{offset of on non-POD type 'bar'}}
69
+ int anonstruct[__builtin_offsetof(bar, x) == 0 ? 1 : -1 ]; // expected-warning{{'offsetof' on non-POD type 'bar'}}
70
70
71
71
72
72
struct LtoRCheck {
@@ -81,7 +81,7 @@ struct Base {
81
81
int Field;
82
82
};
83
83
struct Derived : virtual Base {
84
- void Fun () { (void )__builtin_offsetof (Derived, Field); } // expected-warning {{offset of on non-POD type}} \
84
+ void Fun () { (void )__builtin_offsetof (Derived, Field); } // expected-warning {{'offsetof' on non-POD type}} \
85
85
expected-error {{invalid application of 'offsetof' to a field of a virtual base}}
86
86
};
87
87
}
0 commit comments