REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9258

Files:
  cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
  cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp

Index: cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
===================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
+++ cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
@@ -194,3 +194,22 @@
   void f() { F<int>(); }
 };
 }
+
+namespace PR23194 {
+  struct X {
+    int operator()() const { return 0; }
+  };
+  struct Y {
+    Y(int) {}
+  };
+  template <bool = true> int make_seed_pair() noexcept {
+    struct state_t {
+      X x;
+      Y y{x()};
+    };
+    return 0;
+  }
+  int func() {
+    return make_seed_pair();
+  }
+}
Index: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2233,7 +2233,7 @@
   EnterExpressionEvaluationContext EvalContext(*this,
                                                Sema::PotentiallyEvaluated);
 
-  LocalInstantiationScope Scope(*this);
+  LocalInstantiationScope Scope(*this, true);
 
   // Instantiate the initializer.
   ActOnStartCXXInClassMemberInitializer();

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
===================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
+++ cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
@@ -194,3 +194,22 @@
   void f() { F<int>(); }
 };
 }
+
+namespace PR23194 {
+  struct X {
+    int operator()() const { return 0; }
+  };
+  struct Y {
+    Y(int) {}
+  };
+  template <bool = true> int make_seed_pair() noexcept {
+    struct state_t {
+      X x;
+      Y y{x()};
+    };
+    return 0;
+  }
+  int func() {
+    return make_seed_pair();
+  }
+}
Index: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2233,7 +2233,7 @@
   EnterExpressionEvaluationContext EvalContext(*this,
                                                Sema::PotentiallyEvaluated);
 
-  LocalInstantiationScope Scope(*this);
+  LocalInstantiationScope Scope(*this, true);
 
   // Instantiate the initializer.
   ActOnStartCXXInClassMemberInitializer();
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to