CodeGen may see out-of-line declarations of the various special member
functions when they are explicitly declared, e.g., via a function
template specialization or explicit template instantiation
declaration. Don't try to synthesize bodies for the special member
functions in this case; rather, check whether we have an implicit
declaration and, if so, synthesize the appropriate function
body. Fixes PR5084.

llvm-svn: 83212
diff --git a/clang/test/CodeGenCXX/destructors.cpp b/clang/test/CodeGenCXX/destructors.cpp
index e808057..44d2b29 100644
--- a/clang/test/CodeGenCXX/destructors.cpp
+++ b/clang/test/CodeGenCXX/destructors.cpp
@@ -19,4 +19,12 @@
   ~C();
 };
 
-C::~C() { }
\ No newline at end of file
+C::~C() { }
+
+// PR5084
+template<typename T>
+class A1 {
+  ~A1();
+};
+
+template<> A1<char>::~A1();