diff --git lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaDeclCXX.cpp
index 8280835..dab2d4d 100644
--- lib/Sema/SemaDeclCXX.cpp
+++ lib/Sema/SemaDeclCXX.cpp
@@ -10316,8 +10316,13 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) {
     return;
   }
   if (const FunctionDecl *Prev = Fn->getPreviousDecl()) {
-    Diag(DelLoc, diag::err_deleted_decl_not_first);
-    Diag(Prev->getLocation(), diag::note_previous_declaration);
+    // Don't consider the implicit declaration we generate for explicit
+    // specializations. FIXME: Do not generate these implicit declarations.
+    if (Prev->getTemplateSpecializationKind() != TSK_ExplicitSpecialization
+        || Prev->getPreviousDecl()) {
+      Diag(DelLoc, diag::err_deleted_decl_not_first);
+      Diag(Prev->getLocation(), diag::note_previous_declaration);
+    }
     // If the declaration wasn't the first, we delete the function anyway for
     // recovery.
   }
diff --git test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.delete/p4.cpp test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.delete/p4.cpp
new file mode 100644
index 0000000..16fd5e6
--- /dev/null
+++ test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.delete/p4.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+
+template<typename> void func();
+template<> void func<int>() = delete;
+
+template<typename> void func2();
+template<> void func2<int>(); // expected-note {{previous declaration is here}}
+template<> void func2<int>() = delete; // expected-error {{deleted definition must be first declaration}}
