forked from OSchip/llvm-project
Don't emit unused warning for deleted functions. Fixes rdar://8365684 & http://llvm.org/PR9391.
llvm-svn: 126950
This commit is contained in:
parent
67735bf069
commit
e02831423a
|
@ -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)
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue