[PATCH] D55212: Handle alloc_size attribute on function pointers
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 6 13:56:23 PST 2018
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM aside from two small style nits with the new test file.
================
Comment at: test/SemaCXX/alloc-size.cpp:6
+ int alloc(int) __attribute__((alloc_size(2))); // expected-warning{{'alloc_size' attribute only applies to return values that are pointers}}
+ void* alloc2(int) __attribute__((alloc_size(1))); // expected-error{{'alloc_size' attribute is invalid for the implicit this argument}}
+ void* alloc3(int) __attribute__((alloc_size(2))); // fine
----------------
Can you run this new test file through clang-format?
================
Comment at: test/SemaCXX/alloc-size.cpp:21
+// We should not be warning when assigning function pointers with and without the alloc size attribute
+// since it doesn't change the type of the function
+typedef void * (__attribute__((alloc_size(1))) * my_malloc_fn_pointer_type)(int);
----------------
Add a full stop at the end of the sentence.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55212/new/
https://reviews.llvm.org/D55212
More information about the cfe-commits
mailing list