From 5aab83d53f064cefc454a64656cfc4aa1deb153d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 2 Oct 2017 22:21:16 +0000 Subject: [PATCH] re PR c++/70570 (Assembler error "symbol already defined" from nested lambdas and function-static variable) 2017-10-02 Paolo Carlini PR c++/70570 * g++.dg/cpp1y/lambda-generic-70570.C: New. From-SVN: r253370 --- gcc/testsuite/ChangeLog | 5 +++++ .../g++.dg/cpp1y/lambda-generic-70570.C | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-70570.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aeaa357c2e5..004af663545 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-02 Paolo Carlini + + PR c++/70570 + * g++.dg/cpp1y/lambda-generic-70570.C: New. + 2017-10-02 Paolo Carlini PR c++/79590 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-70570.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-70570.C new file mode 100644 index 00000000000..debe34116fe --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-70570.C @@ -0,0 +1,16 @@ +// PR c++/70570 +// { dg-do assemble { target c++14 } } + +template void foo(T f) { + f(1); +} + +int main() { + static const int x = 42; + foo([](auto y){ + x; + [](){ + x; + }; + }); +} -- 2.30.2