summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/warn-unused-function.c6
-rw-r--r--clang/test/SemaCXX/warn-unused-filescoped.cpp9
2 files changed, 12 insertions, 3 deletions
diff --git a/clang/test/Sema/warn-unused-function.c b/clang/test/Sema/warn-unused-function.c
index 5bbcf18a623..8f4cdcba881 100644
--- a/clang/test/Sema/warn-unused-function.c
+++ b/clang/test/Sema/warn-unused-function.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused-function -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wunused-function -Wunneeded-internal-declaration -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -Wunused %s
// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
@@ -6,7 +6,7 @@ void foo() {}
static void f2() {}
static void f1() {f2();} // expected-warning{{unused}}
-static int f0() { return 17; } // expected-warning{{unused}}
+static int f0() { return 17; } // expected-warning{{not needed and will not be emitted}}
int x = sizeof(f0());
static void f3();
@@ -46,7 +46,7 @@ static void f12(void) { } // expected-warning{{unused}}
static void f12(void);
// PR7923
-static void unused(void) { unused(); } // expected-warning{{unused}}
+static void unused(void) { unused(); } // expected-warning{{not needed and will not be emitted}}
// rdar://8728293
static void cleanupMalloc(char * const * const allocation) { }
diff --git a/clang/test/SemaCXX/warn-unused-filescoped.cpp b/clang/test/SemaCXX/warn-unused-filescoped.cpp
index c32acb0b48b..dbff4b0e68c 100644
--- a/clang/test/SemaCXX/warn-unused-filescoped.cpp
+++ b/clang/test/SemaCXX/warn-unused-filescoped.cpp
@@ -78,3 +78,12 @@ namespace test4 {
void test(A a); // expected-warning {{unused function}}
extern "C" void test4(A a);
}
+
+namespace rdar8733476 {
+ static void foo() { } // expected-warning {{not needed and will not be emitted}}
+
+ template <int>
+ void bar() {
+ foo();
+ }
+}
OpenPOWER on IntegriCloud