aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-func-not-needed.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-12-26 00:13:29 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-12-26 00:13:29 +0000
commit485458aa998c12e43bc9883b49060425d58b351d (patch)
tree78e01f2e404b5d3e846912c5905d02de1aef7760 /test/SemaCXX/warn-func-not-needed.cpp
parenta57b3b4fea1c962678972af8fc74e121ff8b296d (diff)
Use the most recent redecl to decide if it is needed.
This fixes pr14691, which I think is a regression from r168519. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-func-not-needed.cpp')
-rw-r--r--test/SemaCXX/warn-func-not-needed.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-func-not-needed.cpp b/test/SemaCXX/warn-func-not-needed.cpp
new file mode 100644
index 0000000000..437a428664
--- /dev/null
+++ b/test/SemaCXX/warn-func-not-needed.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
+
+namespace test1 {
+ static void f() {} // expected-warning {{is not needed and will not be emitted}}
+ static void f();
+ template <typename T>
+ void foo() {
+ f();
+ }
+}
+
+namespace test2 {
+ static void f() {}
+ static void f();
+ static void g() { f(); }
+ void h() { g(); }
+}