When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144011 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CXX/class/p6-0x.cpp b/test/CXX/class/p6-0x.cpp
index 3384af0..f2cf482 100644
--- a/test/CXX/class/p6-0x.cpp
+++ b/test/CXX/class/p6-0x.cpp
@@ -13,3 +13,18 @@
 static_assert(!__is_trivial(NonTrivial3), "NonTrivial3 is trivial");
 static_assert(!__is_trivial(NonTrivial4), "NonTrivial4 is trivial");
 static_assert(!__is_trivial(NonTrivial5), "NonTrivial5 is trivial");
+
+struct Trivial2 {
+  Trivial2() = default;
+  Trivial2(const Trivial2 &) = default;
+  Trivial2(Trivial2 &&) = default;
+  Trivial2 &operator=(const Trivial2 &) = default;
+  Trivial2 &operator=(Trivial2 &) = default;
+  ~Trivial2() = default;
+};
+
+class NonTrivial6 { ~NonTrivial6(); };
+
+NonTrivial6::~NonTrivial6() = default;
+
+static_assert(!__is_trivial(NonTrivial6), "NonTrivial6 is trivial");