This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Håkon Sandsmark <hsandsmark at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Tue, 27 Feb 2018 19:06:46 +0100
- Subject: Re: [PATCH] Fix PR c++/71546 - lambda capture fails with "was not declared in this scope"
- Authentication-results: sourceware.org; auth=none
- References: <CAK0fzjoPVd+SDieAcGjyz3fBp3gXiCoZD0=DCGAQVSM4+L81vQ@mail.gmail.com>
Hi,
I only have a simple comment about the testcase:
On 27/02/2018 17:42, Håkon Sandsmark wrote:
+++ gcc/testsuite/g++.dg/cpp1y/pr71546.C
@@ -0,0 +1,11 @@
+// PR c++/71546
+// { dg-do compile { target c++14 } }
+// { dg-options "" }
+
+#include <memory>
+
+int main()
+{
+ int x1;
+ [e = std::make_shared <int> (), x1]() {};
+}
Instead of including the whole <memory>, shall we use something like:
namespace std { template<typename> struct make_shared { }; }
int main()
{
int x1;
[e = std::make_shared <int> (), x1]() {};
}
???
Thanks,
Paolo