diff options
author | kelbon <58717435+kelbon@users.noreply.github.com> | 2024-01-20 18:37:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-20 12:37:35 -0500 |
commit | 818de32f31e8075657dd27938e4aeb1a46f3f631 (patch) | |
tree | fe83ecf5715f4e65dbe1cebee2619bbea150c76f /clang/test/Index | |
parent | b9a1e2ab8dead4863834f70cdae56104ec92d041 (diff) | |
download | llvm-818de32f31e8075657dd27938e4aeb1a46f3f631.zip llvm-818de32f31e8075657dd27938e4aeb1a46f3f631.tar.gz llvm-818de32f31e8075657dd27938e4aeb1a46f3f631.tar.bz2 |
Warning for incorrect use of 'pure' attribute (#78200)
This adds a warning when applying the `pure` attribute along with the `const` attribute, or when applying the `pure` attribute to a function with a `void` return type (including constructors and destructors).
Fixes https://github.com/llvm/llvm-project/issues/77482
Diffstat (limited to 'clang/test/Index')
-rw-r--r-- | clang/test/Index/attributes.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Index/attributes.c b/clang/test/Index/attributes.c index a5d10a1..0a9b0bf 100644 --- a/clang/test/Index/attributes.c +++ b/clang/test/Index/attributes.c @@ -4,8 +4,8 @@ struct __attribute__((packed)) Test2 { char a; }; -void pure_fn() __attribute__((pure)); -void const_fn() __attribute__((const)); +char pure_fn() __attribute__((pure)); +char const_fn() __attribute__((const)); void noduplicate_fn() __attribute__((noduplicate)); enum __attribute((flag_enum)) FlagEnum { |