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
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/attr-lifetimebound.cpp
+2-16Lines changed: 2 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -9,25 +9,11 @@ namespace usage_invalid {
9
9
~A() [[clang::lifetimebound]]; // expected-error {{cannot be applied to a destructor}}
10
10
staticint *static_class_member() [[clang::lifetimebound]]; // expected-error {{static member function has no implicit object parameter}}
11
11
int *explicit_object(this A&) [[clang::lifetimebound]]; // expected-error {{explicit object member function has no implicit object parameter}}
12
-
int attr_on_var [[clang::lifetimebound]]; // expected-error {{only applies to parameters and implicit object parameters}}
13
-
int [[clang::lifetimebound]] attr_on_int; // expected-error {{cannot be applied to types}}
14
-
int * [[clang::lifetimebound]] attr_on_int_ptr; // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
15
-
int * [[clang::lifetimebound]] * attr_on_int_ptr_ptr; // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
16
-
int (* [[clang::lifetimebound]] attr_on_func_ptr)(); // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
12
+
int not_function [[clang::lifetimebound]]; // expected-error {{only applies to parameters and implicit object parameters}}
13
+
int [[clang::lifetimebound]] also_not_function; // expected-error {{cannot be applied to types}}
17
14
voidvoid_return_member() [[clang::lifetimebound]]; // expected-error {{'lifetimebound' attribute cannot be applied to an implicit object parameter of a function that returns void; did you mean 'lifetime_capture_by(X)'}}
18
15
};
19
16
int *attr_with_param(int ¶m [[clang::lifetimebound(42)]]); // expected-error {{takes no arguments}}
20
-
21
-
voidattr_on_ptr_arg(int * [[clang::lifetimebound]] ptr); // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
22
-
static_assert((int [[clang::lifetimebound]]) 12); // expected-error {{cannot be applied to types}}
23
-
int* attr_on_unnamed_arg(constint& [[clang::lifetimebound]]); // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
24
-
template <typename T>
25
-
int* attr_on_template_ptr_arg(T * [[clang::lifetimebound]] ptr); // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
26
-
27
-
int (*func_ptr)(int) [[clang::lifetimebound]]; // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
28
-
int (*(*func_ptr_ptr)(int) [[clang::lifetimebound]])(int); // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
29
-
structX {};
30
-
int (X::*member_func_ptr)(int) [[clang::lifetimebound]]; // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
0 commit comments