diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2018-10-24 08:29:24 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2018-10-24 08:29:24 +0000 |
commit | b06c0831376fdaa2ddce2110d57e7d5369db5bb8 (patch) | |
tree | 6d3f89c11713656ad3d6e79cb0579f3b0bb8e496 /test/Index | |
parent | 33c2e18eaf5f30aacf9a9c7da8ca71781fdc4272 (diff) |
[Sema] Do not show unused parameter warnings when body is skipped
Summary: Without the function body, we cannot determine is parameter was used.
Reviewers: ioeric, sammccall
Reviewed By: sammccall
Subscribers: arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53456
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index')
-rw-r--r-- | test/Index/skipped-bodies-unused.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Index/skipped-bodies-unused.cpp b/test/Index/skipped-bodies-unused.cpp new file mode 100644 index 0000000000..fc1ebc8efd --- /dev/null +++ b/test/Index/skipped-bodies-unused.cpp @@ -0,0 +1,8 @@ +// RUN: env CINDEXTEST_SKIP_FUNCTION_BODIES=1 c-index-test -test-load-source all %s -Wunused-parameter 2>&1 \ +// RUN: | FileCheck %s + +// No 'unused parameter' warnings should be shown when skipping the function bodies. +inline int foo(int used, int unused) { + used = 100; +} +// CHECK-NOT: warning: unused parameter |