aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/Sema.cpp2
-rw-r--r--test/SemaCXX/unused-functions.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 0c39e13253..bc398f43ff 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -451,6 +451,8 @@ void Sema::ActOnEndOfTranslationUnit() {
const FunctionDecl *DiagD;
if (!FD->hasBody(DiagD))
DiagD = FD;
+ if (DiagD->isDeleted())
+ continue; // Deleted functions are supposed to be unused.
Diag(DiagD->getLocation(),
isa<CXXMethodDecl>(DiagD) ? diag::warn_unused_member_function
: diag::warn_unused_function)
diff --git a/test/SemaCXX/unused-functions.cpp b/test/SemaCXX/unused-functions.cpp
index cefa9e118a..f164bf2768 100644
--- a/test/SemaCXX/unused-functions.cpp
+++ b/test/SemaCXX/unused-functions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused -verify %s
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -Wunused -verify %s
static int foo(int x) { return x; }
@@ -6,3 +6,5 @@ template<typename T>
T get_from_foo(T y) { return foo(y); }
int g(int z) { return get_from_foo(z); }
+
+namespace { void f() = delete; }