From 54d04ce91ae8e6a2d647200f9443556e6fadc9e2 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 15 Dec 2018 17:10:18 -0500 Subject: [PATCH] Small lambda instantiation tweak. While looking at something else I noticed that we were passing 0 to the "nonclass" parameter here; we might as well pass 1, since capture proxies are always at block scope. * pt.c (tsubst_expr) [DECL_EXPR]: Ignore class-scope bindings when looking up a capture proxy. From-SVN: r267176 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ee9e570687b..9b8dae3c504 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-12-14 Jason Merrill + + * pt.c (tsubst_expr) [DECL_EXPR]: Ignore class-scope bindings when + looking up a capture proxy. + 2018-12-15 Paolo Carlini PR c++/84644 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 20f0d16efe1..79eef12112f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -16911,8 +16911,9 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, tree inst; if (!DECL_PACK_P (decl)) { - inst = lookup_name_real (DECL_NAME (decl), 0, 0, - /*block_p=*/true, 0, LOOKUP_HIDDEN); + inst = lookup_name_real (DECL_NAME (decl), /*prefer_type*/0, + /*nonclass*/1, /*block_p=*/true, + /*ns_only*/0, LOOKUP_HIDDEN); gcc_assert (inst != decl && is_capture_proxy (inst)); } else if (is_normal_capture_proxy (decl)) -- 2.30.2