constexpr: fix typo resulting in move constructors sometimes not being
implicitly marked constexpr when they should be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147955 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index f56d465..3094cd6 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -243,7 +243,7 @@
         data().HasTrivialMoveAssignment = false;
 
       // C++11 [class.ctor]p6:
-      //   If that user-written default cosntructor would satisfy the
+      //   If that user-written default constructor would satisfy the
       //   requirements of a constexpr constructor, the implicitly-defined
       //   default constructor is constexpr.
       if (!BaseClassDecl->hasConstexprDefaultConstructor())
@@ -264,7 +264,7 @@
         // would be ill-formed, the implicit move constructor generated for the
         // derived class calls the base class' copy constructor.
         data().DefaultedMoveConstructorIsConstexpr &=
-          !BaseClassDecl->hasConstexprMoveConstructor();
+          BaseClassDecl->hasConstexprMoveConstructor();
       else if (!BaseClassDecl->hasConstexprCopyConstructor())
         data().DefaultedMoveConstructorIsConstexpr = false;
     }
diff --git a/test/CXX/special/class.copy/p13-0x.cpp b/test/CXX/special/class.copy/p13-0x.cpp
index 30d8c6e..0a9aa62 100644
--- a/test/CXX/special/class.copy/p13-0x.cpp
+++ b/test/CXX/special/class.copy/p13-0x.cpp
@@ -53,3 +53,8 @@
 constexpr Constexpr4 c4a = { ncd };
 constexpr Constexpr4 c4b = Constexpr4(c4a);
 constexpr Constexpr4 c4c = Constexpr4(static_cast<Constexpr4&&>(const_cast<Constexpr4&>(c4b)));
+
+struct Constexpr5Base {};
+struct Constexpr5 : Constexpr5Base { constexpr Constexpr5() {} };
+constexpr Constexpr5 ce5move = Constexpr5();
+constexpr Constexpr5 ce5copy = ce5move;