aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-static-function-inheader.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-06-27 19:43:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-06-27 19:43:29 +0000
commit12d2cc71bfeb1e7be9ce00fc52feab50941cac24 (patch)
tree12e59c88cbec128a0b1cbc3c02e56569c9db72c1 /test/SemaCXX/warn-static-function-inheader.cpp
parent8d852e35adb46e0799538dfc9c80d44f27cd3597 (diff)
patch to suggest 'static' function should be 'static inline'
when it appears to be unused and occurs in a header. // rdar://11202617 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-static-function-inheader.cpp')
-rw-r--r--test/SemaCXX/warn-static-function-inheader.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-static-function-inheader.cpp b/test/SemaCXX/warn-static-function-inheader.cpp
new file mode 100644
index 0000000000..30386d9a25
--- /dev/null
+++ b/test/SemaCXX/warn-static-function-inheader.cpp
@@ -0,0 +1,12 @@
+#include "warn-static-function-inheader.h"
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
+// rdar://11202617
+
+static void another(void) { // expected-warning {{function 'another' is not needed and will not be emitted}}
+}
+
+template <typename T>
+void foo(void) {
+ thing();
+ another();
+}