Implement core issue 5: a temporary created for copy-initialization has a
cv-unqualified type. This is essential in order to allow move-only objects of
const-qualified types to be copy-initialized via a converting constructor.

llvm-svn: 150309
diff --git a/clang/test/SemaCXX/copy-initialization.cpp b/clang/test/SemaCXX/copy-initialization.cpp
index fb83dcf..ea2db0c 100644
--- a/clang/test/SemaCXX/copy-initialization.cpp
+++ b/clang/test/SemaCXX/copy-initialization.cpp
@@ -42,3 +42,26 @@
     f(foo);
   }
 }
+
+namespace DR5 {
+  // Core issue 5: if a temporary is created in copy-initialization, it is of
+  // the cv-unqualified version of the destination type.
+  namespace Ex1 {
+    struct C { };
+    C c;
+    struct A {
+        A(const A&);
+        A(const C&);
+    };
+    const volatile A a = c; // ok
+  }
+
+  namespace Ex2 {
+    struct S {
+      S(S&&); // expected-warning {{C++11}}
+      S(int);
+    };
+    const S a(0);
+    const S b = 0;
+  }
+}