2015-03-05 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Mar 2015 08:48:22 +0000 (08:48 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Mar 2015 08:48:22 +0000 (08:48 +0000)
PR c++/64834
* g++.dg/cpp1y/lambda-generic-uneval1.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221205 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-generic-uneval1.C [new file with mode: 0644]

index a16501a..937afa5 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/64834
+       * g++.dg/cpp1y/lambda-generic-uneval1.C: New.
+
 2015-03-04  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/entry_queues3.adb: New test.
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-uneval1.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-uneval1.C
new file mode 100644 (file)
index 0000000..113eacf
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/64834
+// { dg-do compile { target c++14 } }
+
+template <typename F>
+void e(F f)
+{
+  f(1);
+}
+
+template <int I>
+void bar() {
+    int x;
+    e([&] (const int& y) { (void)sizeof(x); });
+    e([&] (const auto& y) { (void)sizeof(x); });
+}
+
+void baz() { bar<1>(); }