aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/unused-with-error.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-31 07:04:37 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-31 07:04:37 +0000
commit43f0a7c8e06e55092b43d4dd46fe09a4d57298e9 (patch)
tree58680bef24e07dab0345b8a099dd35cde303b2c5 /test/SemaCXX/unused-with-error.cpp
parent6ad5df132a0bcb3f6975362901270be5bf60dc56 (diff)
If there were errors, disable 'unused' warnings since they will mostly be noise.
Fixes rdar://8736362. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/unused-with-error.cpp')
-rw-r--r--test/SemaCXX/unused-with-error.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/unused-with-error.cpp b/test/SemaCXX/unused-with-error.cpp
new file mode 100644
index 0000000000..5660007c3b
--- /dev/null
+++ b/test/SemaCXX/unused-with-error.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused -verify %s
+
+// Make sure 'unused' warnings are disabled when errors occurred.
+static void foo(int *X) { // expected-note {{candidate}}
+}
+void bar(const int *Y) {
+ foo(Y); // expected-error {{no matching function for call}}
+}