PR c++/60992
* pt.c (tsubst_copy): Handle lookup finding a capture proxy.
From-SVN: r246793
+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
{
/* 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);
--- /dev/null
+// PR c++/80267
+// { dg-do compile { target c++11 } }
+
+template <typename> void a() {
+ int b;
+ auto &c = b;
+ [&] {
+ c;
+ [&] { c; };
+ };
+}
+void d() { a<int>(); }