Skip to content

Commit 5936f49

Browse files
patrykstefanskidelcypher
authored andcommitted
[BoundsSafety] Fix Sema/compound-literal-ended_by.c test
After d58d5d6, we emit an error earlier for compound literals that occur outside the body of a function and are not constant expressions. rdar://151424542
1 parent 6929dec commit 5936f49

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

clang/test/BoundsSafety-legacy-checks/Sema/compound-literal-ended_by.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@ struct eb_with_other_data field_initializers_with_side_effects(struct eb_with_ot
176176

177177
struct eb_with_other_data global_eb_with_other_data_side_effect_init =
178178
(struct eb_with_other_data) {
179-
// FIXME: Location of first non-constant is wrong (rdar://81135826)
180-
.start = 0x0, // both-error{{initializer element is not a compile-time constant}}
179+
.start = 0x0,
181180
.end = 0x0,
182-
.other = side_effect()
181+
.other = side_effect() // both-error{{initializer element is not a compile-time constant}}
183182
};
184183

185184
struct eb_with_other_data side_effects_in_ptrs(struct eb_with_other_data* s) {

clang/test/BoundsSafety/Sema/compound-literal-ended_by.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@ struct eb_with_other_data field_initializers_with_side_effects(struct eb_with_ot
172172

173173
struct eb_with_other_data global_eb_with_other_data_side_effect_init =
174174
(struct eb_with_other_data) {
175-
// FIXME: Location of first non-constant is wrong (rdar://81135826)
176-
.start = 0x0, // both-error{{initializer element is not a compile-time constant}}
175+
.start = 0x0,
177176
.end = 0x0,
178-
.other = side_effect()
177+
.other = side_effect() // both-error{{initializer element is not a compile-time constant}}
179178
};
180179

181180
struct eb_with_other_data side_effects_in_ptrs(struct eb_with_other_data* s) {

0 commit comments

Comments
 (0)