aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-09 17:41:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-09 17:41:13 +0000
commit47268a3f2843a8d64f3a6fef1e9a9dde1feb4a8c (patch)
tree27de83043d82a323760b13ecabecf18373b0f948 /test
parent6cd3b9fb8a29bb70fff01719bdde238723d67c10 (diff)
Remove all "used" static functions *after* we have performed all of
the implicit template instantiations we need to perform. Otherwise, we end up erroneously diagnosing static functions as used if they were only used within an implicit template instantiation. Fixes a bunch of spurious failures when building Clang with Clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/unused-functions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/unused-functions.cpp b/test/SemaCXX/unused-functions.cpp
new file mode 100644
index 0000000000..cefa9e118a
--- /dev/null
+++ b/test/SemaCXX/unused-functions.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused -verify %s
+
+static int foo(int x) { return x; }
+
+template<typename T>
+T get_from_foo(T y) { return foo(y); }
+
+int g(int z) { return get_from_foo(z); }