summaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/unused-with-error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/unused-with-error.cpp')
-rw-r--r--clang/test/SemaCXX/unused-with-error.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/unused-with-error.cpp b/clang/test/SemaCXX/unused-with-error.cpp
new file mode 100644
index 0000000..5660007
--- /dev/null
+++ b/clang/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}}
+}