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
char*ref=__builtin_counted_by_ref(ptr->array); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
51
+
char*ref=__builtin_counted_by_ref(ptr->array); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable}}
52
+
char*int_ptr;
53
+
char*p;
52
54
53
-
ref=__builtin_counted_by_ref(ptr->array); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
54
-
ref= (char*)(int*)(42+&*__builtin_counted_by_ref(ptr->array)); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
55
-
foo(__builtin_counted_by_ref(ptr->array)); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
56
-
foo(ref=__builtin_counted_by_ref(ptr->array)); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
55
+
ref=__builtin_counted_by_ref(ptr->array); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable}}
56
+
g(__builtin_counted_by_ref(ptr->array)); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be passed into a function}}
57
+
g(ref=__builtin_counted_by_ref(ptr->array)); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable}}
57
58
58
-
if ((ref=__builtin_counted_by_ref(ptr->array))) // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
59
+
if ((ref=__builtin_counted_by_ref(ptr->array))) // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable}}
59
60
;
60
61
61
-
for (char*p=__builtin_counted_by_ref(ptr->array); p&&*p; ++p) // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
62
+
for (p=__builtin_counted_by_ref(ptr->array); p&&*p; ++p) // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable}}
62
63
;
63
64
64
-
return__builtin_counted_by_ref(ptr->array); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be assigned to a variable, have its address taken, or passed into or returned from a function}}
65
+
return__builtin_counted_by_ref(ptr->array); // expected-error {{value returned by '__builtin_counted_by_ref' cannot be returned from a function}}
*(__builtin_counted_by_ref(ptr->array) +4) =37; // expected-error {{value returned by '__builtin_counted_by_ref' cannot be used in a binary expression}}
69
-
__builtin_counted_by_ref(ptr->array)[3] =37; // expected-error {{value returned by '__builtin_counted_by_ref' cannot be used in an array subscript expression}}
69
+
*(__builtin_counted_by_ref(ptr->array) +4) =37; // expected-error {{value returned by '__builtin_counted_by_ref' cannot be used in a binary expression}}
70
+
__builtin_counted_by_ref(ptr->array)[3] =37; // expected-error {{value returned by '__builtin_counted_by_ref' cannot be used in an array subscript expression}}
70
71
}
71
72
72
73
structnon_fam_struct {
@@ -77,10 +78,10 @@ struct non_fam_struct {
77
78
};
78
79
79
80
void*test7(structnon_fam_struct*ptr, intsize) {
80
-
*__builtin_counted_by_ref(ptr->array) =size// expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
81
-
*__builtin_counted_by_ref(&ptr->array[0]) =size; // expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
82
-
*__builtin_counted_by_ref(ptr->pointer) =size; // expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
83
-
*__builtin_counted_by_ref(&ptr->pointer[0]) =size; // expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
81
+
*__builtin_counted_by_ref(ptr->array) =size// expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
82
+
*__builtin_counted_by_ref(&ptr->array[0]) =size; // expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
83
+
*__builtin_counted_by_ref(ptr->pointer) =size; // expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
84
+
*__builtin_counted_by_ref(&ptr->pointer[0]) =size; // expected-error {{'__builtin_counted_by_ref' argument must reference a flexible array member}}
0 commit comments