diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template9.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template9.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template9.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template9.C new file mode 100644 index 0000000..c1d010b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template9.C @@ -0,0 +1,15 @@ +// PR c++/54276 +// { dg-do link { target c++11 } } + +template <typename T> +void foo(T) +{ + static int x = 1; + auto f = [] { return x + 1; }; + f(); +} + +int main() +{ + foo(4); +} |