summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-17 18:42:26 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-17 18:42:26 +0000
commit6041a711469e1ac18e68f3aa393f5ff42d54c2dd (patch)
tree21c2babb7bca477faccb8c53bb995477ada40676
parent7121416fdcb253a7e4e3f8f1e1b441cf564b9ce2 (diff)
downloadgcc-6041a711469e1ac18e68f3aa393f5ff42d54c2dd.tar.gz
PR c++/67244
* pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@226951 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C29
3 files changed, 34 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 222efbfc1d9..b088ee39ea6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2015-08-17 Jason Merrill <jason@redhat.com>
+ PR c++/67244
+ * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies.
+
PR c++/65734
* class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e7e4960ae20..5f56d09e263 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15860,6 +15860,8 @@ tsubst_copy_and_build (tree t,
LAMBDA_EXPR_THIS_CAPTURE (r) = NULL_TREE;
+ insert_pending_capture_proxies ();
+
RETURN (build_lambda_object (r));
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C
new file mode 100644
index 00000000000..3ebdf3b36ae
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C
@@ -0,0 +1,29 @@
+// PR c++/67244
+// { dg-do compile { target c++11 } }
+
+class A {
+public:
+ int operator*();
+};
+template <typename T, typename Predicate>
+void searchGen(int, int, T, Predicate p4) {
+ p4(0);
+}
+template <typename...> struct B;
+template <typename MetaFunction, typename Type, typename... Types>
+struct B<MetaFunction, Type, Types...> {
+ static void exec() { MetaFunction::template exec<Type>; }
+};
+template <typename MetaFunction, typename... Types> void forEachType() {
+ B<MetaFunction, Types...>::exec;
+}
+namespace {
+struct C {
+ template <typename T> void exec() {
+ A __trans_tmp_1;
+ const auto target = *__trans_tmp_1;
+ searchGen(0, 0, 0, [=](T) { [=] { target; }; });
+ }
+};
+}
+void ____C_A_T_C_H____T_E_S_T____75() { forEachType<C, int>; }