File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -110,3 +110,23 @@ int somefunc(int i) {
110
110
// pedantic-ref-warning {{overflow in expression; result is 131073}}
111
111
112
112
}
113
+
114
+ /// FIXME: The following test is incorrect in the new interpreter.
115
+ /// The null pointer returns 16 from its getIntegerRepresentation().
116
+ struct ArrayStruct {
117
+ char n [1 ];
118
+ };
119
+ struct AA {
120
+ char name2 [(int )& ((struct ArrayStruct * )0 )-> n - 1 ]; // expected-warning {{cast to smaller integer type}} \
121
+ // expected-warning {{folded to constant array}} \
122
+ // pedantic-expected-warning {{cast to smaller integer type}} \
123
+ // pedantic-expected-warning {{folded to constant array}} \
124
+ // ref-error {{array size is negative}} \
125
+ // ref-warning {{cast to smaller integer type}} \
126
+ // pedantic-ref-error {{array size is negative}} \
127
+ // pedantic-ref-warning {{cast to smaller integer type}}
128
+ };
129
+ _Static_assert (sizeof (struct AA ) == 15 , "" ); // ref-error {{failed}} \
130
+ // ref-note {{1 == 15}} \
131
+ // pedantic-ref-error {{failed}} \
132
+ // pedantic-ref-note {{1 == 15}}
You can’t perform that action at this time.
0 commit comments