From e5b87132fe80abec4bb94179b26c6655b1ad7023 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 13 Sep 2017 11:57:56 +0000 Subject: [PATCH] re PR c++/59949 (lambda expression as default argument of function template causes "already defined" messages in assembler) 2017-09-13 Paolo Carlini PR c++/59949 * g++.dg/cpp0x/lambda/lambda-defarg7.C: New. From-SVN: r252079 --- gcc/testsuite/ChangeLog | 5 +++++ .../g++.dg/cpp0x/lambda/lambda-defarg7.C | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg7.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c1fc2dbbd3..55a9720825f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-13 Paolo Carlini + + PR c++/59949 + * g++.dg/cpp0x/lambda/lambda-defarg7.C: New. + 2017-09-13 Wilco Dijkstra * gcc.target/aarch64/vmov_n_1.c: Update dup scan-assembler. diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg7.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg7.C new file mode 100644 index 00000000000..c76b7fdb461 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg7.C @@ -0,0 +1,16 @@ +// PR c++/59949 +// { dg-do assemble { target c++11 } } + +struct A +{ + template A(T) { } +}; + +template +void +stuff(A = []{ }) { } + +int main() { + stuff(); + stuff(); +} -- 2.30.2