Commit c60faeee by Jason Merrill Committed by Jason Merrill

PR c++/80267 - ICE with nested capture of reference

	PR c++/60992
	* pt.c (tsubst_copy): Handle lookup finding a capture proxy.

From-SVN: r246793
parent 310ce882
2017-04-07 Jason Merrill <jason@redhat.com>
PR c++/80267 - ICE with nested capture of reference
PR c++/60992
* pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2017-04-07 Marek Polacek <polacek@redhat.com>
PR sanitizer/80348
......
......@@ -14566,7 +14566,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
/* First try name lookup to find the instantiation. */
r = lookup_name (DECL_NAME (t));
if (r)
if (r && !is_capture_proxy (r))
{
/* Make sure that the one we found is the one we want. */
tree ctx = DECL_CONTEXT (t);
......
// PR c++/80267
// { dg-do compile { target c++11 } }
template <typename> void a() {
int b;
auto &c = b;
[&] {
c;
[&] { c; };
};
}
void d() { a<int>(); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment