Index: lib/AST/ExprConstant.cpp
==================================================================
--- lib/AST/ExprConstant.cpp
+++ lib/AST/ExprConstant.cpp
@@ -5238,10 +5238,32 @@
   bool VisitCXXConstructExpr(const CXXConstructExpr *E) {
     return VisitConstructExpr(E);
   }
   bool VisitCallExpr(const CallExpr *E) {
     return VisitConstructExpr(E);
+  }
+  bool VisitLambdaExpr(const LambdaExpr *E) {
+    CXXRecordDecl *Record = E->getLambdaClass();
+
+    // Lambda expression class cannot be instantiated if has captures or if
+    // it does not have a trivial constexpr default constructor.
+    if (E->capture_size() != 0                    ||
+        !Record->field_empty()                    ||
+        !Record->hasConstexprDefaultConstructor() ||
+        !Record->hasTrivialDefaultConstructor())
+      return Error(E);
+
+    assert(Record->getNumBases() == 0 && "lambda cannot have bases");
+
+    Result.set(E, Info.CurrentCall->Index);
+
+    // Create an empty struct as the lambda object instance.
+    APValue &This = Info.CurrentCall->createTemporary(E, false);
+    if (This.isUninit())
+      This = APValue(APValue::UninitStruct(), /*NumBases=*/0, /*NumFields=*/0);
+
+    return true;
   }
 };
 } // end anonymous namespace
 
 /// Evaluate an expression of record type as a temporary.

Index: lib/Sema/SemaLambda.cpp
==================================================================
--- lib/Sema/SemaLambda.cpp
+++ lib/Sema/SemaLambda.cpp
@@ -1264,11 +1264,11 @@
                                 DeclarationNameInfo(ConversionName, 
                                   Loc, ConvNameLoc),
                                 ConvTy, 
                                 ConvTSI,
                                 /*isInline=*/true, /*isExplicit=*/false,
-                                /*isConstexpr=*/false, 
+                                /*isConstexpr=*/true,
                                 CallOperator->getBody()->getLocEnd());
   Conversion->setAccess(AS_public);
   Conversion->setImplicit(true);
 
   if (Class->isGenericLambda()) {

Index: test/CXX/expr/expr.const/p2-0x.cpp
==================================================================
--- test/CXX/expr/expr.const/p2-0x.cpp
+++ test/CXX/expr/expr.const/p2-0x.cpp
@@ -275,11 +275,11 @@
   }
 }
 
 // - a lambda-expression (5.1.2);
 struct Lambda {
-  int n : []{ return 1; }(); // expected-error {{constant expression}} expected-error {{integral constant expression}}
+  int n : []{ return 1; }(); // expected-error {{constant expression}} expected-error {{integral constant expression}} expected-note{{non-constexpr function 'operator()'}} expected-note{{declared here}}
 };
 
 // - an lvalue-to-rvalue conversion (4.1) unless it is applied to
 namespace LValueToRValue {
   // - a non-volatile glvalue of integral or enumeration type that refers to a

Index: test/CodeGenCXX/mangle-lambdas.cpp
==================================================================
--- test/CodeGenCXX/mangle-lambdas.cpp
+++ test/CodeGenCXX/mangle-lambdas.cpp
@@ -1,7 +1,10 @@
 // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s
 
+// CHECK: @_ZN13StaticMembersIfE1fE = weak_odr global i32 ()* @_ZN13StaticMembersIfE1fMUlvE_8__invokeEv
+// CHECK: @_ZL1t = internal constant %struct.Table { i32 ()* @"_ZN3$_48__invokeEv" }
+// CHECK: @p_t = global %struct.Table* @_ZL1t
 // CHECK: @_ZZNK7PR12917IJiiEE1nMUlvE_clEvE1n = linkonce_odr global i32 0
 // CHECK: @_ZZZN7PR12917IJicdEEC1EicdEd_NKUlvE_clEvE1n = linkonce_odr global i32 0
 // CHECK: @_ZZZN7PR12917IJicdEEC1EicdEd0_NKUlvE_clEvE1n = linkonce_odr global i32 0
 // CHECK: @_ZZZN7PR12917IJicdEEC1EicdEd1_NKUlvE_clEvE1n = linkonce_odr global i32 0
 
@@ -142,16 +145,16 @@
 // CHECK-LABEL: define internal void @__cxx_global_var_init2()
 // CHECK: call i32 @_Z13accept_lambdaIN13StaticMembersIfE1zMUlvE_EEiT_
 // CHECK: declare i32 @_Z13accept_lambdaIN13StaticMembersIfE1zMUlvE_EEiT_()
 template float StaticMembers<float>::z;
 
-// CHECK-LABEL: define internal void @__cxx_global_var_init3()
-// CHECK: call {{.*}} @_ZNK13StaticMembersIfE1fMUlvE_cvPFivEEv
-// CHECK-LABEL: define linkonce_odr i32 ()* @_ZNK13StaticMembersIfE1fMUlvE_cvPFivEEv
+// Assignment to @_ZN13StaticMembersIfE1fE at top of file.
+// CHECK-LABEL: define linkonce_odr i32 @_ZN13StaticMembersIfE1fMUlvE_8__invokeEv()
+// CHECK: call i32 @_ZNK13StaticMembersIfE1fMUlvE_clEv
 template int (*StaticMembers<float>::f)();
 
-// CHECK-LABEL: define internal void @__cxx_global_var_init4
+// CHECK-LABEL: define internal void @__cxx_global_var_init3
 // CHECK: call i32 @"_ZNK13StaticMembersIdE3$_2clEv"
 // CHECK-LABEL: define internal i32 @"_ZNK13StaticMembersIdE3$_2clEv"
 // CHECK: ret i32 42
 template<> double StaticMembers<double>::z = []{return 42; }();
 
@@ -162,10 +165,19 @@
 void use_func_template() {
   // CHECK: call i32 @"_ZZ13func_templateIiEvT_ENK3$_3clEv"
   func_template<int>();
 }
 
+constexpr struct Table {
+  int (*func)();
+} t = {
+  .func = [](){ return 1234; }
+};
+
+const Table *p_t = &t;
+// CHECK-LABEL: define internal i32 @"_ZN3$_48__invokeEv"() #1
+// CHECK: call i32 @"_ZNK3$_4clEv"
 
 template<typename...T> struct PR12917 {
   PR12917(T ...t = []{ static int n = 0; return ++n; }());
 
   static int n[3];
@@ -245,10 +257,14 @@
 // CHECK: ret i32 1
 // CHECK-LABEL: define linkonce_odr i32 @_ZNK7Members1xMUlvE0_clEv
 // CHECK: ret i32 2
 // CHECK-LABEL: define linkonce_odr i32 @_ZNK7Members1yMUlvE_clEv
 // CHECK: ret i32 3
+// CHECK-LABEL: define internal i32 @"_ZNK3$_4clEv"
+// CHECK: ret i32 1234
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK13StaticMembersIfE1fMUlvE_clEv
+// CHECK: ret i32 5
 
 // Check linkage of the various lambdas.
 // CHECK-LABEL: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE_clEv
 // CHECK: ret i32 1
 // CHECK-LABEL: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE0_clEv

Index: test/SemaCXX/cxx1y-generic-lambdas.cpp
==================================================================
--- test/SemaCXX/cxx1y-generic-lambdas.cpp
+++ test/SemaCXX/cxx1y-generic-lambdas.cpp
@@ -857,23 +857,29 @@
 namespace ns1 {
 
 struct X1 {  
   struct X2 {
     enum { E = [](auto i) { return i; }(3) }; //expected-error{{inside of a constant expression}}\
-                                          //expected-error{{not an integral constant}}
+                                              //expected-error{{not an integral constant}}\
+                                              //expected-note{{non-constexpr function 'operator()<int>'}}\
+                                              //expected-note{{declared here}}
     int L = ([] (int i) { return i; })(2);
     void foo(int i = ([] (int i) { return i; })(2)) { }
     int B : ([](int i) { return i; })(3); //expected-error{{inside of a constant expression}}\
-                                          //expected-error{{not an integral constant}}
+                                          //expected-error{{not an integral constant}}\
+                                          //expected-note{{non-constexpr function 'operator()'}}\
+                                          //expected-note{{declared here}}
     int arr[([](int i) { return i; })(3)]; //expected-error{{inside of a constant expression}}\
                                            //expected-error{{must have a constant size}}
     int (*fp)(int) = [](int i) { return i; };
     void fooptr(int (*fp)(char) = [](char c) { return 0; }) { }
     int L2 = ([](auto i) { return i; })(2);
     void fooG(int i = ([] (auto i) { return i; })(2)) { }
     int BG : ([](auto i) { return i; })(3); //expected-error{{inside of a constant expression}}  \
-                                             //expected-error{{not an integral constant}}
+                                            //expected-error{{not an integral constant}}\
+                                            //expected-note{{non-constexpr function 'operator()<int>'}}\
+                                            //expected-note{{declared here}}
     int arrG[([](auto i) { return i; })(3)]; //expected-error{{inside of a constant expression}}\
                                            //expected-error{{must have a constant size}}
     int (*fpG)(int) = [](auto i) { return i; };
     void fooptrG(int (*fp)(char) = [](auto c) { return 0; }) { }
   };
@@ -885,18 +891,22 @@
   template<class T>
   struct X2 {
     int L = ([] (T i) { return i; })(2);
     void foo(int i = ([] (int i) { return i; })(2)) { }
     int B : ([](T i) { return i; })(3); //expected-error{{inside of a constant expression}}\
-                                          //expected-error{{not an integral constant}}
+                                        //expected-error{{not an integral constant}}\
+                                        //expected-note{{non-constexpr function 'operator()'}}\
+                                        //expected-note{{declared here}}
     int arr[([](T i) { return i; })(3)]; //expected-error{{inside of a constant expression}}\
                                            //expected-error{{must have a constant size}}
     int (*fp)(T) = [](T i) { return i; };
     void fooptr(T (*fp)(char) = [](char c) { return 0; }) { }
     int L2 = ([](auto i) { return i; })(2);
     void fooG(T i = ([] (auto i) { return i; })(2)) { }
-    int BG : ([](auto i) { return i; })(3); //expected-error{{not an integral constant}}
+    int BG : ([](auto i) { return i; })(3); //expected-error{{not an integral constant}}\
+                                            //expected-note{{non-constexpr function 'operator()<int>'}}\
+                                            //expected-note{{declared here}}
     int arrG[([](auto i) { return i; })(3)]; //expected-error{{must have a constant size}}
     int (*fpG)(T) = [](auto i) { return i; };
     void fooptrG(T (*fp)(char) = [](auto c) { return 0; }) { }
     template<class U = char> int fooG2(T (*fp)(U) = [](auto a) { return 0; }) { return 0; }
     template<class U = char> int fooG3(T (*fp)(U) = [](auto a) { return 0; });

