Skip to content

Commit 4871cd4

Browse files
committed
test func types
1 parent 48b5561 commit 4871cd4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/test/SemaCXX/attr-lifetimebound.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ namespace usage_invalid {
2323
int* attr_on_unnamed_arg(const int& [[clang::lifetimebound]]); // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
2424
template <typename T>
2525
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+
struct X {};
30+
int (X::*member_func_ptr)(int) [[clang::lifetimebound]]; // expected-error {{'lifetimebound' attribute only applies to parameters and implicit object parameters}}
2631
}
2732

2833
namespace usage_ok {

0 commit comments

Comments
 (0)