diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-02-25 20:40:06 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-02-25 20:40:06 +0000 |
commit | 836684aff3aeacb981ff500622d98981e9ac89ae (patch) | |
tree | 6bac41f650592730fce892d91126fb24ae653ce9 /clang/test/Sema/alloc-size.c | |
parent | bd0f656631d12b8e65a7961e4c73371e2580ddb6 (diff) | |
download | bcm5719-llvm-836684aff3aeacb981ff500622d98981e9ac89ae.tar.gz bcm5719-llvm-836684aff3aeacb981ff500622d98981e9ac89ae.zip |
When diagnosing the arguments to alloc_size, report the failing argument using a 1-based index instead of a 0-based index for consistency.
Patch by Joel Denny.
llvm-svn: 326058
Diffstat (limited to 'clang/test/Sema/alloc-size.c')
-rw-r--r-- | clang/test/Sema/alloc-size.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/Sema/alloc-size.c b/clang/test/Sema/alloc-size.c index 7004a5a7d7f..56181511a19 100644 --- a/clang/test/Sema/alloc-size.c +++ b/clang/test/Sema/alloc-size.c @@ -3,14 +3,14 @@ void *fail1(int a) __attribute__((alloc_size)); //expected-error{{'alloc_size' attribute takes at least 1 argument}} void *fail2(int a) __attribute__((alloc_size())); //expected-error{{'alloc_size' attribute takes at least 1 argument}} -void *fail3(int a) __attribute__((alloc_size(0))); //expected-error{{'alloc_size' attribute parameter 0 is out of bounds}} -void *fail4(int a) __attribute__((alloc_size(2))); //expected-error{{'alloc_size' attribute parameter 2 is out of bounds}} +void *fail3(int a) __attribute__((alloc_size(0))); //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}} +void *fail4(int a) __attribute__((alloc_size(2))); //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}} -void *fail5(int a, int b) __attribute__((alloc_size(0, 1))); //expected-error{{'alloc_size' attribute parameter 0 is out of bounds}} -void *fail6(int a, int b) __attribute__((alloc_size(3, 1))); //expected-error{{'alloc_size' attribute parameter 3 is out of bounds}} +void *fail5(int a, int b) __attribute__((alloc_size(0, 1))); //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}} +void *fail6(int a, int b) __attribute__((alloc_size(3, 1))); //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}} -void *fail7(int a, int b) __attribute__((alloc_size(1, 0))); //expected-error{{'alloc_size' attribute parameter 0 is out of bounds}} -void *fail8(int a, int b) __attribute__((alloc_size(1, 3))); //expected-error{{'alloc_size' attribute parameter 3 is out of bounds}} +void *fail7(int a, int b) __attribute__((alloc_size(1, 0))); //expected-error{{'alloc_size' attribute parameter 2 is out of bounds}} +void *fail8(int a, int b) __attribute__((alloc_size(1, 3))); //expected-error{{'alloc_size' attribute parameter 2 is out of bounds}} int fail9(int a) __attribute__((alloc_size(1))); //expected-warning{{'alloc_size' attribute only applies to return values that are pointers}} |