You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #10528 from hnrklssn/eng/PR-149359009
In fceb9ce (llvm#134769) upstream changed the diagnostic engine to always wrap expressions in single quotes. We already had manual wrapping for most of those, so the manual single quotes needed to be removed. In other placed the test cases needed to be updated to reflect the new output.
rdar://149359009
"argument of function call '%0' in '%select{__counted_by|__sized_by|__counted_by_or_null|__sized_by_or_null}1' attribute is not a constant expression">;
12612
+
"argument of function call %0 in '%select{__counted_by|__sized_by|__counted_by_or_null|__sized_by_or_null}1' attribute is not a constant expression">;
"initalizer for %select{count|size|'__counted_by' pointer|'__sized_by' pointer|'__counted_by_or_null' pointer|'__sized_by_or_null' pointer|'__ended_by' pointer|end pointer}0 with side effects is not yet supported">;
"bounds attribute '%select{__bidi_indexable|__indexable|__single|__unsafe_indexable}0' cannot be applied to attributed type %1 in this context%select{| due to the surrounding 'typeof' specifier}2">;
Copy file name to clipboardExpand all lines: clang/test/BoundsSafety/AST/struct-init-with-side-effects.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ void test_count_annot() {
98
98
structs_count_annots1= {
99
99
.len=10,
100
100
.ptr=arr,
101
-
// expected-warning@+1{{initializer getlen() has a side effect; this may lead to an unexpected result because the evaluation order of initialization list expressions is indeterminate}}
101
+
// expected-warning@+1{{initializer 'getlen()' has a side effect; this may lead to an unexpected result because the evaluation order of initialization list expressions is indeterminate}}
102
102
.dummy=getlen()
103
103
};
104
104
structs_count_annots2;
@@ -157,7 +157,7 @@ void test_range_annot() {
157
157
structs_range_annots1= {
158
158
.end=arr+10,
159
159
.start=arr,
160
-
// expected-warning@+1{{initializer getlen() has a side effect; this may lead to an unexpected result because the evaluation order of initialization list expressions is indeterminate}}
160
+
// expected-warning@+1{{initializer 'getlen()' has a side effect; this may lead to an unexpected result because the evaluation order of initialization list expressions is indeterminate}}
Copy file name to clipboardExpand all lines: clang/test/BoundsSafety/Sema/address-taken-dynamic-count-decls.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ int main() {
97
97
98
98
foo(&s.len, &s.buf);
99
99
foo(&local_len, &s.buf); // expected-error{{incompatible dynamic count pointer argument to parameter of type}}
100
-
foo(&t.len, &t.buf); // expected-error{{incompatible count expression (*out_len) vs. (len + 1) in argument to function}}
100
+
foo(&t.len, &t.buf); // expected-error{{incompatible count expression '*out_len' vs. 'len + 1' in argument to function}}
101
101
// expected-error@+1{{passing address of 'len' as an indirect parameter; must also pass 'buf2' or its address because the type of 'buf2', 'int *__single __counted_by(len)' (aka 'int *__single'), refers to 'len'}}
102
102
foo(&u.len, &u.buf);
103
103
bar(&s.len, &s.buf); // expected-error{{passing address of 'len' referred to by '__counted_by' to a parameter that is not referred to by the same attribute}}
0 commit comments