From: Paolo Carlini Date: Thu, 22 Oct 2015 14:55:14 +0000 (+0000) Subject: re PR c++/67838 (Rejects-valid-code: templated lambda variable.) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c34eb7423bf4ccfc12bcd352f8d6c2a2e99a24a;p=gcc.git re PR c++/67838 (Rejects-valid-code: templated lambda variable.) 2015-10-22 Paolo Carlini PR c++/67838 * g++.dg/cpp1y/var-templ46.C: New. From-SVN: r229175 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ea3d941331..be7d83bbc16 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-22 Paolo Carlini + + PR c++/67838 + * g++.dg/cpp1y/var-templ46.C: New. + 2015-10-22 Richard Biener PR tree-optimization/58497 diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ46.C b/gcc/testsuite/g++.dg/cpp1y/var-templ46.C new file mode 100644 index 00000000000..2fb34536384 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ46.C @@ -0,0 +1,20 @@ +// PR c++/67838 +// { dg-do compile { target c++14 } } + +template +static auto TestFunc = [](int param1) +{ + return param1; +}; + +template +static void test(Func func) +{ + func(12345); +} + +int main() +{ + test(TestFunc); + test(TestFunc); +}