Skip to content

Commit 1f4a5d8

Browse files
committed
[clang][Interp] Fix broken test case again
Instead of asserting that it's wrong, assert the correct value. See the discussion in a8b5994
1 parent a1df10d commit 1f4a5d8

File tree

1 file changed

+8
-10
lines changed
  • clang/test/AST/Interp

1 file changed

+8
-10
lines changed

clang/test/AST/Interp/c.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,11 @@ int somefunc(int i) {
117117
struct ArrayStruct {
118118
char n[1];
119119
};
120-
struct AA {
121-
char name2[(int)&((struct ArrayStruct*)0)->n - 1]; // expected-warning {{folded to constant array}} \
122-
// pedantic-expected-warning {{folded to constant array}} \
123-
// ref-error {{array size is negative}} \
124-
// pedantic-ref-error {{array size is negative}}
125-
};
126-
_Static_assert(sizeof(struct AA) == 15, ""); // ref-error {{failed}} \
127-
// ref-note {{ == 15}} \
128-
// pedantic-ref-error {{failed}} \
129-
// pedantic-ref-note {{ == 15}}
120+
char name2[(int)&((struct ArrayStruct*)0)->n]; // expected-warning {{folded to constant array}} \
121+
// pedantic-expected-warning {{folded to constant array}} \
122+
// ref-warning {{folded to constant array}} \
123+
// pedantic-ref-warning {{folded to constant array}}
124+
_Static_assert(sizeof(name2) == 0, ""); // expected-error {{failed}} \
125+
// expected-note {{evaluates to}} \
126+
// pedantic-expected-error {{failed}} \
127+
// pedantic-expected-note {{evaluates to}}

0 commit comments

Comments
 (0)