summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-10-24 08:29:24 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-10-24 08:29:24 +0000
commit47e06bb81f9f8a70d6eb09c944861eaac10f7002 (patch)
treef117868ab8a1ad35c02c37f33a816e131dce7dc1 /clang/test
parentdf9c7e3001377d6da7098fdd4fc5c54293620d37 (diff)
downloadbcm5719-llvm-47e06bb81f9f8a70d6eb09c944861eaac10f7002.tar.gz
bcm5719-llvm-47e06bb81f9f8a70d6eb09c944861eaac10f7002.zip
[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 llvm-svn: 345122
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Index/skipped-bodies-unused.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Index/skipped-bodies-unused.cpp b/clang/test/Index/skipped-bodies-unused.cpp
new file mode 100644
index 00000000000..fc1ebc8efd8
--- /dev/null
+++ b/clang/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
OpenPOWER on IntegriCloud