@@ -11,12 +11,12 @@ struct P {
1111};
1212
1313void 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'}}
1515}
1616
1717struct Base { int x; };
1818struct 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}}
2020
2121const int o2 = sizeof (__builtin_offsetof(Derived, x));
2222
@@ -51,9 +51,9 @@ struct Derived2 : public Base1, public Base2 {
5151 int z;
5252};
5353
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'}}
5757
5858// offsetof referring to anonymous struct in base.
5959// PR7769
@@ -66,7 +66,7 @@ struct foo {
6666struct bar : public foo {
6767};
6868
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'}}
7070
7171
7272struct LtoRCheck {
@@ -81,7 +81,7 @@ struct Base {
8181 int Field;
8282};
8383struct 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}} \
8585 expected-error {{invalid application of 'offsetof' to a field of a virtual base}}
8686};
8787}
0 commit comments